Consolidated code for walkingflame and swalking flame, added new dormant state
[supertux.git] / src / badguy / stumpy.cpp
index 1ad03a6..8c47c66 100644 (file)
@@ -25,7 +25,7 @@
 
 #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) :
@@ -33,7 +33,7 @@ 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");
 }
@@ -43,7 +43,7 @@ Stumpy::Stumpy(const Vector& pos, Direction d) :
   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);
@@ -102,8 +102,8 @@ Stumpy::collision_squished(GameObject& object)
     // 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);