reparation dash plus supression des warning

This commit is contained in:
Estrela Allan p1923381
2020-05-04 15:02:08 +02:00
parent dfe4bd0ae5
commit 6d4576bf8c
4 changed files with 25 additions and 12 deletions

View File

@ -113,13 +113,17 @@ void GestionPlayer::traitementInput()
Input* i = Input::get_singleton();
// move in X directions
p.velocity.x = 0.0f; // rest x, keyboard action will change this
if (i->is_action_pressed("ui_left"))
playerState.Flags.left = true;
if (i->is_action_pressed("ui_right"))
playerState.Flags.right = true;
if (i->is_action_pressed("dash"))
playerState.Flags.dash = true;
{
if (playerState.Flags.left || playerState.Flags.right)
{
playerState.Flags.dash = true;
}
}
if (i->is_action_pressed("attack"))
playerState.Flags.attack = true;
if (i->is_action_pressed("attack2"))
@ -275,8 +279,16 @@ void GestionPlayer::PlayerLogic_OnGround(float dt)
else if (playerState.Flags.dash)
{
sprite_player_ptr->play("dash");
p.velocity.x = -speed;
p.velocity.x =+ 1000.0f;
if (playerState.Flags.left)
{
p.velocity.x = -speed * 2.0f;
sprite_player_ptr->set_flip_h(true);
}
else if (playerState.Flags.right)
{
p.velocity.x = +speed * 2.0f;
sprite_player_ptr->set_flip_h(false);
}
playerState.Flags.isInBlockingAnimation = true;
playerState.Flags.dash = false;
}
@ -304,6 +316,7 @@ void GestionPlayer::PlayerLogic_OnGround(float dt)
}
else
{
p.velocity.x = 0.0f; // rest x, keyboard action will change this
sprite_player_ptr->play("Idle");
}
}