reader.get("cycle", cycle);
reader.get("badguy", badguy);
if (badguy == "mrrocket") {
+ if (start_dir == AUTO) log_warning << "Setting a Dispenser's direction to AUTO is no good idea" << std::endl;
sprite->set_action(dir == LEFT ? "working-left" : "working-right");
}
else {sprite->set_action("dropper");}
void
Dispenser::activate()
-{
+{
+ if(frozen)
+ return;
dispense_timer.start(cycle, true);
launch_badguy();
}
+void
+Dispenser::deactivate()
+{
+ dispense_timer.stop();
+}
+
+//TODO: Add launching velocity to certain badguys
bool
Dispenser::collision_squished(Player& player)
{
}
}
-//TODO: Add launching velocity to certain badguys
// Add themed randomizer
-// Fix initial direction (everyone but MrRocket walks the wrong direction)
void
Dispenser::launch_badguy()
{
}
}
+void
+Dispenser::freeze()
+{
+ BadGuy::freeze();
+ dispense_timer.stop();
+}
+
+void
+Dispenser::unfreeze()
+{
+ BadGuy::unfreeze();
+ activate();
+}
+
+bool
+Dispenser::is_freezable() const
+{
+ return true;
+}
IMPLEMENT_FACTORY(Dispenser, "dispenser")