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 walker.cxx,1.9,1.10


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/actions walker.cxx,1.9,1.10
Date: 28 Jun 2002 09:51:48 -0000

Update of /usr/local/cvsroot/Games/Pingus/src/actions
In directory dark:/tmp/cvs-serv30237/actions

Modified Files:
        walker.cxx 
Log Message:
- changed gametime to become a member of the World instead of a singleton
- fixed a bug in the walker (a bridge on a hill works now)

Index: walker.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/walker.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- walker.cxx  26 Jun 2002 19:13:13 -0000      1.9
+++ walker.cxx  28 Jun 2002 09:51:46 -0000      1.10
@@ -117,19 +117,22 @@
       // Pingu is walking up the mountain 
       // we can continue walking up. search for the correct y_pos
       int y_inc = 0;
+      int possible_y_step = 0;
       bool found_next_step = false;
-       for(y_inc=-max_steps; y_inc <= max_steps; y_inc++) // up-hill
+       for(y_inc=-max_steps; y_inc <= max_steps; y_inc++) // up/down-hill scan
        if (rel_getpixel(1, y_inc) ==  GroundpieceData::GP_NOTHING
            && rel_getpixel(1, y_inc - 1) !=  GroundpieceData::GP_NOTHING)
-         {
+         { // FIXME:
            found_next_step = true;
-           break;
+           possible_y_step = y_inc;
+           // No break here, since we always want to use the highest possible 
position
+           //break;
          }
       
       if (found_next_step)
        {
          pingu->pos.x += pingu->direction;
-         pingu->pos.y -= y_inc; // pos.y has a reversed co-system to 
rel_getpixel()?
+         pingu->pos.y -= possible_y_step; // pos.y has a reversed co-system to 
rel_getpixel()?
        }
       else
        {




reply via email to

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