#include <math.h>
-static const float WALKSPEED = 120;
+static const float STUMPY_SPEED = 120;
static const float INVINCIBLE_TIME = 1;
Stumpy::Stumpy(const Reader& reader) :
mystate(STATE_NORMAL),
invincible_timer()
{
- walk_speed = WALKSPEED;
+ walk_speed = STUMPY_SPEED;
max_drop_height = 16;
sound_manager->preload("sounds/mr_treehit.ogg");
}
mystate(STATE_INVINCIBLE),
invincible_timer()
{
- walk_speed = WALKSPEED;
+ walk_speed = STUMPY_SPEED;
max_drop_height = 16;
sound_manager->preload("sounds/mr_treehit.ogg");
invincible_timer.start(INVINCIBLE_TIME);
// TODO: provide convenience function in MovingSprite or MovingObject?
for (int i = 0; i < 25; i++) {
Vector ppos = bbox.get_middle();
- float angle = systemRandom.randf(-M_PI_2, M_PI_2);
- float velocity = systemRandom.randf(45, 90);
+ float angle = graphicsRandom.randf(-M_PI_2, M_PI_2);
+ float velocity = graphicsRandom.randf(45, 90);
float vx = sin(angle)*velocity;
float vy = -cos(angle)*velocity;
Vector pspeed = Vector(vx, vy);
return CONTINUE;
}
-IMPLEMENT_FACTORY(Stumpy, "stumpy");
-
/* EOF */