state = STATE_FLAT;
sprite->set_action(dir == LEFT ? "flat-left" : "flat-right");
sprite->set_fps(64);
-
+
physic.set_velocity_x(0);
- physic.set_velocity_y(0);
-
+ physic.set_velocity_y(0);
+
flat_timer.start(4);
}
sprite->set_fps(64);
physic.set_velocity_x(0);
- physic.set_velocity_y(0);
-
+ physic.set_velocity_y(0);
+
// start a timer to delay addition of upward movement until we are (hopefully) out from under the player
kicked_delay_timer.start(0.05);
}
+bool
+Snail::can_break(){
+ return state == STATE_KICKED;
+}
void
Snail::active_update(float elapsed_time)
if(hit.left || hit.right) {
sound_manager->play("sounds/iceblock_bump.wav", get_pos());
-#if 0
- // TODO move this into BonusBlock code
- // open bonusblocks, crash bricks
- BonusBlock* bonusblock = dynamic_cast<BonusBlock*> (&object);
- if(bonusblock) {
- bonusblock->try_open();
- }
- Brick* brick = dynamic_cast<Brick*> (&object);
- if(brick) {
- brick->try_break();
- }
-#endif
if( ( dir == LEFT && hit.left ) || ( dir == RIGHT && hit.right) ){
dir = (dir == LEFT) ? RIGHT : LEFT;
sprite->set_action(dir == LEFT ? "flat-left" : "flat-right");
}
break;
}
-
+
}
HitResponse
sound_manager->play("sounds/stomp.wav", get_pos());
be_flat();
break;
-
+
case STATE_FLAT:
sound_manager->play("sounds/kick.wav", get_pos());
case STATE_KICKED_DELAY:
break;
-
+
}
player.bounce(*this);