: WalkingBadguy(reader, "images/creatures/mr_iceblock/mr_iceblock.sprite", "left", "right"), ice_state(ICESTATE_NORMAL), squishcount(0)
{
walk_speed = 80;
- max_drop_height = 600;
+ max_drop_height = 600;
sound_manager->preload("sounds/iceblock_bump.wav");
sound_manager->preload("sounds/stomp.wav");
sound_manager->preload("sounds/kick.wav");
MrIceBlock::MrIceBlock(const Vector& pos, Direction d)
: WalkingBadguy(pos, d, "images/creatures/mr_iceblock/mr_iceblock.sprite", "left", "right"), ice_state(ICESTATE_NORMAL), squishcount(0)
{
- walk_speed = 80;
- max_drop_height = 600;
+ walk_speed = 80;
+ max_drop_height = 600;
sound_manager->preload("sounds/iceblock_bump.wav");
sound_manager->preload("sounds/stomp.wav");
sound_manager->preload("sounds/kick.wav");
return FORCE_MOVE;
}
}
-
+
return BadGuy::collision_player(player, hit);
}
{
if(ice_state == state)
return;
-
- if(state == ICESTATE_FLAT)
- flags |= FLAG_PORTABLE;
- else
- flags &= ~FLAG_PORTABLE;
switch(state) {
case ICESTATE_NORMAL:
case ICESTATE_FLAT:
sound_manager->play("sounds/stomp.wav", get_pos());
physic.set_velocity_x(0);
- physic.set_velocity_y(0);
-
+ physic.set_velocity_y(0);
+
sprite->set_action(dir == LEFT ? "flat-left" : "flat-right");
flat_timer.start(4);
break;
set_group(COLGROUP_MOVING);
}
+bool
+MrIceBlock::is_portable() const
+{
+ return ice_state == ICESTATE_FLAT;
+}
+
IMPLEMENT_FACTORY(MrIceBlock, "mriceblock")