diff options
| author | realtradam <[email protected]> | 2022-01-27 01:38:28 -0500 |
|---|---|---|
| committer | realtradam <[email protected]> | 2022-01-27 01:38:28 -0500 |
| commit | 20499b05caab986b1b33b22d035c70b2716f2163 (patch) | |
| tree | 3f9480c9aec748f8a363a244697fff1edb9a9528 | |
| parent | 250c98636e4925adfb23fccb94633107c7d7a11f (diff) | |
| download | orc-arena-of-time-20499b05caab986b1b33b22d035c70b2716f2163.tar.gz orc-arena-of-time-20499b05caab986b1b33b22d035c70b2716f2163.zip | |
cleaner turning back and forth
| -rw-r--r-- | src/logic.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/logic.rb b/src/logic.rb index 022d3a8..a4eecac 100644 --- a/src/logic.rb +++ b/src/logic.rb @@ -366,7 +366,6 @@ FECS::Scn::Play.add( y_vel = ent.component[FECS::Cmp::Velocity].y x_vel = ent.component[FECS::Cmp::Velocity].x velocity_mag = Math.sqrt((x_vel**2) + (y_vel**2)) - #sprite.tileset.step((velocity_mag*0.04) * Rl.frame_time) # if took damaged if player.state == 'damaged' # @@ -375,9 +374,13 @@ FECS::Scn::Play.add( # if velocity opposite of direction if ((x_vel.positive?) && (player.state_direction == 'left')) || ((x_vel.negative?) && (player.state_direction == 'right')) # change to changing_direction + if player.state == 'changing_direction' + PlayerTileset.frame = 1 + else player.state = 'changing_direction' # reset frame PlayerTileset.frame = 0 + end if player.state_direction == 'right' player.state_direction = 'left' PlayerTileset.frames = PlayerAnimations[:turning_left] |
