pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] CVS: Games/Pingus/src/actions faller.cxx, 1.41, 1.42 slider


From: address@hidden
Subject: [Pingus-CVS] CVS: Games/Pingus/src/actions faller.cxx, 1.41, 1.42 slider.cxx, 1.19, 1.20
Date: Sat, 27 Mar 2004 15:19:10 +0100

Update of /var/lib/cvs/Games/Pingus/src/actions
In directory dark:/tmp/cvs-serv30484

Modified Files:
        faller.cxx slider.cxx 
Log Message:
small behaviour improvement


Index: faller.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/actions/faller.cxx,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- faller.cxx  18 Oct 2003 23:17:27 -0000      1.41
+++ faller.cxx  27 Mar 2004 14:19:08 -0000      1.42
@@ -165,7 +165,7 @@
 bool
 Faller::change_allowed (ActionName new_action)
 {
-  return (new_action == Actions::Floater);
+  return new_action == Actions::Floater || new_action == Actions::Climber;
 }
 
 } // namespace Actions

Index: slider.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/actions/slider.cxx,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- slider.cxx  18 Oct 2003 23:17:27 -0000      1.19
+++ slider.cxx  27 Mar 2004 14:19:08 -0000      1.20
@@ -44,23 +44,26 @@
 
   sprite.update();
 
-  for (int i = 0; i < speed; ++i)
+  for (int i = 0; i < speed && rel_getpixel(1, 0) == Groundtype::GP_NOTHING; 
++i)
     {
       pingu->set_x(pingu->get_x() + pingu->direction);
 
       if (rel_getpixel(0, -1) ==  Groundtype::GP_NOTHING)
-       {
-         speed = (speed > 5) ? 5 : speed;
+        {
+          speed = (speed > 5) ? 5 : speed;
 
-         if (pingu->direction.is_right()) {
-           pingu->set_velocity(pingu->get_velocity() + Vector(speed, 0.0));
-         } else {
-           pingu->set_velocity(pingu->get_velocity() + Vector(-speed, 0.0));
-         }
+          if (pingu->direction.is_right())
+                                         {
+              pingu->set_velocity(pingu->get_velocity() + Vector(speed, 0.0));
+            } 
+          else
+                                         {
+              pingu->set_velocity(pingu->get_velocity() + Vector(-speed, 0.0));
+            }
 
-         pingu->set_action(Actions::Walker);
+          pingu->set_action(Actions::Walker);
           return;
-       }
+        }
     }
 
   speed -= 7 * 0.025f;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]