Removed trailing whitespace from all *.?pp files
[supertux.git] / src / badguy / stumpy.cpp
index cdf2878..5a61070 100644 (file)
 
 #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) :
-  WalkingBadguy(reader, "images/creatures/mr_tree/stumpy.sprite","left","right"), 
+  WalkingBadguy(reader, "images/creatures/mr_tree/stumpy.sprite","left","right"),
   mystate(STATE_NORMAL),
   invincible_timer()
 {
-  walk_speed = WALKSPEED;
+  walk_speed = STUMPY_SPEED;
   max_drop_height = 16;
   sound_manager->preload("sounds/mr_treehit.ogg");
 }
 
 Stumpy::Stumpy(const Vector& pos, Direction d) :
-  WalkingBadguy(pos, d, "images/creatures/mr_tree/stumpy.sprite","left","right"), 
+  WalkingBadguy(pos, d, "images/creatures/mr_tree/stumpy.sprite","left","right"),
   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);
@@ -159,6 +159,10 @@ Stumpy::collision_badguy(BadGuy& badguy, const CollisionHit& hit)
   return CONTINUE;
 }
 
-IMPLEMENT_FACTORY(Stumpy, "stumpy");
+bool
+Stumpy::is_freezable() const
+{
+  return true;
+}
 
 /* EOF */