- Made miniswig support HSQUIRRELVM arguments (and realized it was not needed
[supertux.git] / src / title.cpp
index 3ae54f6..ae2eaaf 100644 (file)
@@ -69,7 +69,7 @@ static Surface* logo;
 static Surface* img_choose_subset;
 
 static bool walking;
-static Timer2 random_timer;
+static Timer random_timer;
 
 static int frame;
 
@@ -246,10 +246,10 @@ void draw_demo(float elapsed_time)
   controller->press(Controller::RIGHT);
   
   if(random_timer.check() || 
-      (walking && (int) last_tux_x_pos == (int) tux->get_pos().x)) {
+      (walking && fabsf(last_tux_x_pos - tux->get_pos().x)) < .1) {
     walking = false;
   } else {
-      if(!walking && (int) tux->get_pos().y == (int) last_tux_y_pos) {
+      if(!walking && fabsf(tux->get_pos().y - last_tux_y_pos) < .1) {
         random_timer.start(float(rand() % 3000 + 3000) / 1000.);
         walking = true;
       }