badguy/haywire.cpp: Use BadGuy::get_nearest_player().
[supertux.git] / src / badguy / mole.cpp
index 291d86e..c9a40cd 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <math.h>
 
-static const float IDLE_TIME = 0.2f; /**< time to wait before and after throwing */
+static const float MOLE_WAIT_TIME = 0.2f; /**< time to wait before and after throwing */
 static const float THROW_TIME = 4.6f; /**< time to spend throwing */
 static const float THROW_INTERVAL = 1; /**< time between two thrown rocks */
 static const float THROW_VELOCITY = 400; /**< initial velocity of thrown rocks */
@@ -88,7 +88,7 @@ Mole::throw_rock()
   float px = get_bbox().get_middle().x;
   float py = get_bbox().get_middle().y;
 
-  float angle = systemRandom.rand(90 - 15, 90 + 15) * (M_PI / 180);
+  float angle = gameRandom.rand(90 - 15, 90 + 15) * (M_PI / 180);
   float vx = cos(angle) * THROW_VELOCITY;
   float vy = -sin(angle) * THROW_VELOCITY;
 
@@ -139,7 +139,7 @@ Mole::set_state(MoleState new_state)
     case PRE_THROWING:
       sprite->set_action("idle");
       set_colgroup_active(COLGROUP_DISABLED);
-      timer.start(IDLE_TIME);
+      timer.start(MOLE_WAIT_TIME);
       break;
     case THROWING:
       sprite->set_action("idle");
@@ -150,7 +150,7 @@ Mole::set_state(MoleState new_state)
     case POST_THROWING:
       sprite->set_action("idle");
       set_colgroup_active(COLGROUP_DISABLED);
-      timer.start(IDLE_TIME);
+      timer.start(MOLE_WAIT_TIME);
       break;
     case PEEKING:
       sprite->set_action("peeking", 1);