Skip to content

Commit

Permalink
The energy regen timer always restarts when the player presses A.
Browse files Browse the repository at this point in the history
  • Loading branch information
alxm committed May 25, 2018
1 parent 28d2e72 commit 749be33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DefendPluto/obj_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ void z_player_tick(bool CheckInput)
int16_t maxSpeed = Z_PLAYER_SPEED_MAX;

if(CheckInput && z_button_pressed(Z_BUTTON_A)) {
z_timer_restart(Z_TIMER_PLAYER_REGEN_ENERGY);

if(hasEnergy(Z_PLAYER_ENERGY_USE_SHOOTING)) {
z_timer_restart(Z_TIMER_PLAYER_REGEN_ENERGY);
maxSpeed = Z_PLAYER_SPEED_MAX / 2;

if(!z_timer_running(Z_TIMER_PLAYER_SHOOT_DELAY)
Expand All @@ -170,7 +171,6 @@ void z_player_tick(bool CheckInput)
Z_PLAYER_SHOOT_KICK_DS);

useEnergy(Z_PLAYER_ENERGY_USE_SHOOTING);
z_timer_restart(Z_TIMER_PLAYER_REGEN_ENERGY);

z_sfx_play(Z_SFX_PLAYER_SHOOT);
z_light_start(Z_LIGHT_PLAYER_SHOOTING);
Expand Down

0 comments on commit 749be33

Please sign in to comment.