(background (image "arctis.jpg")
(speed 0.5))
(secretarea (x 400) (y 128) (message "You found a secret area!"))
- (dispenser (x 500) (y 128) (badguy "snowball"))
+ (dispenser (x 500) (y 128) (badguy "snowball") (cycle 3))
(spawn-points
(name "main")
(x 100)
#include "dispenser.h"
#include "badguy/bouncing_snowball.h"
-#define DISPENSE_TIME 3
-
Dispenser::Dispenser(LispReader& reader)
{
reader.read_float("x", start_position.x);
reader.read_float("y", start_position.y);
+ reader.read_float("cycle", cycle);
reader.read_string("badguy", badguy);
bbox.set_size(32, 32);
sprite = sprite_manager->create("snowball");
writer.write_float("x", get_pos().x);
writer.write_float("y", get_pos().y);
+ writer.write_float("cycle", cycle);
writer.write_string("badguy", badguy);
writer.end_list("dispenser");
void
Dispenser::activate()
{
- dispense_timer.start(DISPENSE_TIME, true);
+ dispense_timer.start(cycle, true);
}
bool