pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] r3371 - trunk/pingus/src/actions


From: grumbel at BerliOS
Subject: [Pingus-CVS] r3371 - trunk/pingus/src/actions
Date: Mon, 29 Oct 2007 02:45:35 +0100

Author: grumbel
Date: 2007-10-29 02:45:34 +0100 (Mon, 29 Oct 2007)
New Revision: 3371

Modified:
   trunk/pingus/src/actions/faller.cpp
Log:
- fixed halloween1 faller-not-dieing bug

Modified: trunk/pingus/src/actions/faller.cpp
===================================================================
--- trunk/pingus/src/actions/faller.cpp 2007-10-29 01:15:43 UTC (rev 3370)
+++ trunk/pingus/src/actions/faller.cpp 2007-10-29 01:45:34 UTC (rev 3371)
@@ -59,7 +59,12 @@
   // Pingu stands on ground
   if (rel_getpixel(0, -1) !=  Groundtype::GP_NOTHING)
     {
-      pingu->set_action(Actions::Walker);
+      // FIXME: Why handle this here and not in the mover loop below?
+      std::cout << "Pingus landed: " << pingu->get_velocity().y << " deadly: " 
<< deadly_velocity << std::endl;
+      if (pingu->get_velocity().y > deadly_velocity)
+        pingu->set_action(Actions::Splashed);
+      else
+        pingu->set_action(Actions::Walker);
       return;
     }
 
@@ -106,12 +111,18 @@
               // Did we stop too fast?
               else if (fabs(pingu->get_velocity().y) > deadly_velocity)
                 {
+                  std::cout << "Pingus splashed: " << pingu->get_velocity().y 
<< " " << deadly_velocity << std::endl;
                   pingu->set_action(Actions::Splashed);
                 }
               else if (fabs(pingu->get_velocity().x) > deadly_velocity)
                 {
                   pout(PINGUS_DEBUG_ACTIONS) << "Pingu: x Smashed on ground, 
jumping" << std::endl;
+                  std::cout << "Pingus X Smash, what to do?: " << 
pingu->get_velocity().x << " " << deadly_velocity << std::endl;
                 }
+              else
+                {
+                  // ???
+                }
 
               break;
             }
@@ -121,13 +132,13 @@
                    && rel_getpixel(0, pingu_height + 1) != 
Groundtype::GP_NOTHING)
             {
               // Don't make the Pingu go up any further.
-              move.y = 0.0f;
+              move.y     = 0.0f;
               velocity.y = 0.0f;
             }
           else
             {
               // Make Pingu bounce off wall
-              move.x = -(move.x / 3.0f);
+              move.x     = -(move.x / 3.0f);
               velocity.x = -(velocity.x / 3.0f);
 
               // Make the Pingu face the correct direction.  NB: Pingu may





reply via email to

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