--- a/src/Player.cc Sun Dec 07 20:47:25 2008 +0000
+++ b/src/Player.cc Sun Dec 07 20:49:49 2008 +0000
@@ -109,16 +109,20 @@
// handle movement left/right by applying a horizontal force, but limit the player's speed
// also update facing if needed
- if ((input & INPUT_MOVE_LEFT) && (velocity.x > -PLAYER_MAX_SPEED)) {
- if(!(input & INPUT_MOVE_RIGHT))
+ if (!((input & INPUT_MOVE_LEFT) && (input & INPUT_MOVE_RIGHT))) {
+ if (input & INPUT_MOVE_LEFT) {
+ if (velocity.x > -PLAYER_MAX_SPEED)
+ move_force.x -= PLAYER_MOVE_FORCE;
+
setFacing(false);
- move_force.x -= PLAYER_MOVE_FORCE;
- }
+ }
- if ((input & INPUT_MOVE_RIGHT) && (velocity.x < PLAYER_MAX_SPEED)) {
- if(!(input & INPUT_MOVE_LEFT))
- setFacing(true);
- move_force.x += PLAYER_MOVE_FORCE;
+ if (input & INPUT_MOVE_RIGHT) {
+ if (velocity.x < PLAYER_MAX_SPEED)
+ move_force.x += PLAYER_MOVE_FORCE;
+
+ setFacing(true);
+ }
}
// handle aim by creating a aim angle delta