Skip to content
Snippets Groups Projects
Commit 0fd039c9 authored by Will's avatar Will
Browse files

injetada modificacoes com base na dificuldade escolhida

parent 47b84fe7
Branches master
No related tags found
No related merge requests found
......@@ -5,9 +5,9 @@ public abstract class Controller : MonoBehaviour
{
public event System.Action<int> handChange;
[SerializeField] protected float speed;
[SerializeField] protected float jumpForce;
[SerializeField] protected float maxStamina;
protected float speed;
protected float jumpForce;
protected float maxStamina;
protected float currentStamina;
protected Animator animatorController;
[HideInInspector] public int currentHand;
......
......@@ -6,7 +6,6 @@ public class CrossOverScript : AtkSkills
{
private Rigidbody2D rb;
private bool isActive;
[SerializeField] float speedModifier;
// Use this for initialization
void Start()
......@@ -41,7 +40,7 @@ public class CrossOverScript : AtkSkills
controller.updateMovementLockStates();
while (isActive)
{
rb.velocity = new Vector2 (-1, controller.currentHand) * controller.getSpeed() * speedModifier;
rb.velocity = new Vector2 (-1, controller.currentHand) * controller.getSpeed() * SettingsPersistance.INSTANCE.difficulty.getSpeedModifier();
yield return null;
}
controller.updateMovementLockStates();
......
......@@ -111,7 +111,7 @@ public class GameManager : MonoBehaviour
{
threw = true;
float xdistance;
float time = 0.8f + force <= 0 ? -force : 0.8f + force;
float time = SettingsPersistance.INSTANCE.difficulty.getForce() + force <= 0 ? -force : SettingsPersistance.INSTANCE.difficulty.getForce() + force;
xdistance = target.position.x - throwPoint.position.x;
float ydistance;
ydistance = target.position.y - throwPoint.position.y;
......
......@@ -28,6 +28,9 @@ public class OpponentController : Controller
animatorController = GetComponent<Animator>();
rb = GetComponent<Rigidbody2D>();
gameManager = FindObjectOfType<GameManager>();
maxStamina = new Easy().getMaxStamina();
speed = new Easy().getSpeed();
jumpForce = new Easy().getJumpForce();
}
private void Update()
......
......@@ -28,6 +28,9 @@ public class PlayerController : Controller
{
controlType = new KeyBoardControl ();
animatorController = GetComponent<Animator>();
maxStamina = SettingsPersistance.INSTANCE.difficulty.getMaxStamina();
speed = SettingsPersistance.INSTANCE.difficulty.getSpeed();
jumpForce = SettingsPersistance.INSTANCE.difficulty.getJumpForce();
}
private void updateStamina(float cost)
......
......@@ -16,7 +16,7 @@ public abstract class Skills : MonoBehaviour
{
if (skillCost != null)
{
skillCost(cost);
skillCost(cost * SettingsPersistance.INSTANCE.difficulty.getCostModifier());
}
}
}
......
......@@ -7,7 +7,6 @@ public class StepBackScript : AtkSkills
{
private Rigidbody2D rb;
private bool isActive;
[SerializeField] float speedModifier;
// Use this for initialization
void Start ()
{
......@@ -41,7 +40,7 @@ public class StepBackScript : AtkSkills
controller.updateMovementLockStates();
while(isActive)
{
rb.velocity = new Vector2(1, controller.currentHand) * controller.getSpeed() * speedModifier;
rb.velocity = new Vector2(1, controller.currentHand) * controller.getSpeed() * SettingsPersistance.INSTANCE.difficulty.getSpeedModifier();
yield return null;
}
controller.updateMovementLockStates();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment