sprite->set_action(dir == LEFT ? "idle-left" : "idle-right");
recover_timer.start(RECOVER_TIME);
} else
if (newState == JUMPING) {
sprite->set_action(dir == LEFT ? "jumping-left" : "jumping-right");
sprite->set_action(dir == LEFT ? "idle-left" : "idle-right");
recover_timer.start(RECOVER_TIME);
} else
if (newState == JUMPING) {
sprite->set_action(dir == LEFT ? "jumping-left" : "jumping-right");
- physic.vx = (dir == LEFT ? -HORIZONTAL_SPEED : HORIZONTAL_SPEED);
- physic.vy = VERTICAL_SPEED;
+ physic.set_velocity_x(dir == LEFT ? -HORIZONTAL_SPEED : HORIZONTAL_SPEED);
+ physic.set_velocity_y(VERTICAL_SPEED);
sound_manager->play( HOP_SOUND, get_pos());
} else
if (newState == FALLING) {
sound_manager->play( HOP_SOUND, get_pos());
} else
if (newState == FALLING) {