uh you can switch players now
This commit is contained in:
parent
a0bfc600ef
commit
cb4470f2d6
11 changed files with 582 additions and 235 deletions
|
|
@ -16,11 +16,15 @@ public class Player : Entity
|
|||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
Vector2 movement = new Vector2(Input.GetAxis("Horizontal") * stats.speed, stats.rb.linearVelocityY);
|
||||
if (Input.GetKeyDown(KeyCode.Space) && stats.OnGround())
|
||||
if (!stats.isStalled)
|
||||
{
|
||||
movement.y = stats.jumpPower;
|
||||
Vector2 movement = new Vector2(Input.GetAxis("Horizontal") * stats.speed, stats.rb.linearVelocityY);
|
||||
if (Input.GetKeyDown(KeyCode.Space) && stats.OnGround())
|
||||
{
|
||||
movement.y = stats.jumpPower;
|
||||
}
|
||||
FlipSprite(movement);
|
||||
stats.rb.linearVelocity = movement;
|
||||
}
|
||||
stats.rb.linearVelocity = movement;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue