Checking if badguy is active before double-killing in a few more places
[supertux.git] / src / badguy / mrtree.cpp
index 65f81aa..8c688d4 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <math.h>
 
-static const float WALKSPEED = 100;
+static const float TREE_SPEED = 100;
 
 static const float POISONIVY_WIDTH = 32;
 static const float POISONIVY_HEIGHT = 32;
@@ -36,7 +36,7 @@ static const float POISONIVY_Y_OFFSET = 24;
 MrTree::MrTree(const Reader& reader)
   : WalkingBadguy(reader, "images/creatures/mr_tree/mr_tree.sprite","left","right")
 {
-  walk_speed = WALKSPEED;
+  walk_speed = TREE_SPEED;
   max_drop_height = 16;
   sound_manager->preload("sounds/mr_tree.ogg");
 }
@@ -61,8 +61,8 @@ MrTree::collision_squished(GameObject& object)
   // TODO: provide convenience function in MovingSprite or MovingObject?
   for (int px = (int)stumpy->get_bbox().p1.x; px < (int)stumpy->get_bbox().p2.x; px+=10) {
     Vector ppos = Vector(px, stumpy->get_bbox().p1.y-5);
-    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);