Move to a state machine

This commit is contained in:
2014-06-14 12:06:41 -07:00
parent f32e38145a
commit de58d5d1f3

View File

@@ -912,7 +912,6 @@ function setSpriteMovement(spr)
y = 75;
spr.animations.play("bipedwalk" + dir);
} else {
console.log("Sprite has no recognizable state");
spr.body.velocity.x = 0;
spr.body.velocity.y = 0;
spr.animations.stop();
@@ -969,9 +968,7 @@ GameState.prototype.check_input = function()
newstate = STATE_NONE;
}
console.log(player.state);
exchangeState(player, (STATES_FACE | STATES_MOVEMENT), newstate);
console.log(player.state);
setSpriteMovement(player);
}