mirror of
https://github.com/luksamuk/engine-psx.git
synced 2025-04-28 13:28:02 +03:00
Make player reset action when hitting horizontal springs
This commit is contained in:
parent
a6089ca702
commit
ea56260554
1 changed files with 4 additions and 0 deletions
|
@ -402,6 +402,8 @@ _spring_update(ObjectState *state, ObjectTableEntry *, VECTOR *pos, uint8_t is_r
|
||||||
player.anim_dir = -1;
|
player.anim_dir = -1;
|
||||||
state->anim_state.animation = 1;
|
state->anim_state.animation = 1;
|
||||||
sound_play_vag(sfx_sprn, 0);
|
sound_play_vag(sfx_sprn, 0);
|
||||||
|
if(player.action != ACTION_ROLLING)
|
||||||
|
player_set_action(&player, ACTION_NONE);
|
||||||
} else if(state->flipmask & MASK_FLIP_ROTCW) { // Right-pointing spring
|
} else if(state->flipmask & MASK_FLIP_ROTCW) { // Right-pointing spring
|
||||||
//player.pos.vx = (solidity_vx + solidity_w + player_width + 8) << 12;
|
//player.pos.vx = (solidity_vx + solidity_w + player_width + 8) << 12;
|
||||||
player.ev_left.collided = 0; // Detach player from left wall if needed
|
player.ev_left.collided = 0; // Detach player from left wall if needed
|
||||||
|
@ -411,6 +413,8 @@ _spring_update(ObjectState *state, ObjectTableEntry *, VECTOR *pos, uint8_t is_r
|
||||||
player.anim_dir = 1;
|
player.anim_dir = 1;
|
||||||
state->anim_state.animation = 1;
|
state->anim_state.animation = 1;
|
||||||
sound_play_vag(sfx_sprn, 0);
|
sound_play_vag(sfx_sprn, 0);
|
||||||
|
if(player.action != ACTION_ROLLING)
|
||||||
|
player_set_action(&player, ACTION_NONE);
|
||||||
} else if(state->flipmask == 0) { // Top-pointing spring
|
} else if(state->flipmask == 0) { // Top-pointing spring
|
||||||
player.pos.vy = (solidity_vy - (player_height >> 1)) << 12;
|
player.pos.vy = (solidity_vy - (player_height >> 1)) << 12;
|
||||||
player.grnd = 0;
|
player.grnd = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue