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 basher.cxx,1.15,1.16 blocker.


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/actions basher.cxx,1.15,1.16 blocker.cxx,1.9,1.10 bridger.cxx,1.15,1.16 climber.cxx,1.11,1.12 digger.cxx,1.13,1.14 faller.cxx,1.23,1.24 floater.cxx,1.15,1.16 miner.cxx,1.11,1.12 slider.cxx,1.9,1.10 walker.cxx,1.22,1.23
Date: 16 Sep 2002 20:31:11 -0000

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

Modified Files:
        basher.cxx blocker.cxx bridger.cxx climber.cxx digger.cxx 
        faller.cxx floater.cxx miner.cxx slider.cxx walker.cxx 
Log Message:
- some groundpiece splitting/moving

Index: basher.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/basher.cxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- basher.cxx  14 Sep 2002 19:06:33 -0000      1.15
+++ basher.cxx  16 Sep 2002 20:31:09 -0000      1.16
@@ -96,7 +96,7 @@
 void
 Basher::walk_forward()
 {
-  if (rel_getpixel(0, -1) ==  GroundpieceData::GP_NOTHING) {
+  if (rel_getpixel(0, -1) ==  Groundtype::GP_NOTHING) {
     // We are in the air... lets fall...
     pingu->set_action(Actions::Faller);
   } else {
@@ -121,7 +121,7 @@
       // up to head collision height.
       for (int j = bash_height + 1; j <= 26; ++j)
        {
-         if (rel_getpixel(i,j) == GroundpieceData::GP_GROUND)
+         if (rel_getpixel(i,j) == Groundtype::GP_GROUND)
            {
              pout(PINGUS_DEBUG_ACTIONS) << "Basher: Found something to dig..." 
<< std::endl;
              return true;

Index: blocker.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/blocker.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- blocker.cxx 14 Sep 2002 19:06:33 -0000      1.9
+++ blocker.cxx 16 Sep 2002 20:31:09 -0000      1.10
@@ -39,14 +39,14 @@
                                                "pingus"));
   sprite.set_align_center_bottom ();
 
-  if (rel_getpixel(0,-1)     ==  GroundpieceData::GP_NOTHING
-      && rel_getpixel(0, -2) ==  GroundpieceData::GP_GROUND)
+  if (rel_getpixel(0,-1)     ==  Groundtype::GP_NOTHING
+      && rel_getpixel(0, -2) ==  Groundtype::GP_GROUND)
     {
       pingu->set_x(pingu->get_x() + 1);
     } 
-  else if (rel_getpixel(0,-1) ==  GroundpieceData::GP_NOTHING
-          && rel_getpixel(0, -2) ==  GroundpieceData::GP_NOTHING
-          && rel_getpixel(0,-3) ==  GroundpieceData::GP_GROUND)
+  else if (rel_getpixel(0,-1) ==  Groundtype::GP_NOTHING
+          && rel_getpixel(0, -2) ==  Groundtype::GP_NOTHING
+          && rel_getpixel(0,-3) ==  Groundtype::GP_GROUND)
     {
       pingu->set_y(pingu->get_y() + 2);
     }
@@ -72,7 +72,7 @@
 bool
 Blocker::standing_on_ground()
 {
-  return (rel_getpixel(0,-1) !=  GroundpieceData::GP_NOTHING);
+  return (rel_getpixel(0,-1) !=  Groundtype::GP_NOTHING);
 }
 
 bool

Index: bridger.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/bridger.cxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- bridger.cxx 14 Sep 2002 19:06:33 -0000      1.15
+++ bridger.cxx 16 Sep 2002 20:31:09 -0000      1.16
@@ -177,7 +177,7 @@
 bool
 Bridger::way_is_free()
 {
-  return (rel_getpixel(4,2) ==  GroundpieceData::GP_NOTHING)
+  return (rel_getpixel(4,2) ==  Groundtype::GP_NOTHING)
     && !head_collision_on_walk(4, 2)
     && !head_collision_on_walk(8, 4);
 }
@@ -196,7 +196,7 @@
       WorldObj::get_world()->get_colmap()->put(brick_r, 
                                               static_cast<int>(pingu->get_x() 
+ 10 - brick_r.get_width()),
                                               static_cast<int>(pingu->get_y()),
-                                              GroundpieceData::GP_BRIDGE);
+                                              Groundtype::GP_BRIDGE);
       WorldObj::get_world()->get_gfx_map()->put(brick_r,
                                                static_cast<int>(pingu->get_x() 
+ 10 - brick_r.get_width()),
                                                
static_cast<int>(pingu->get_y()));
@@ -206,7 +206,7 @@
       WorldObj::get_world()->get_colmap()->put(brick_r, 
                                               static_cast<int>(pingu->get_x() 
- 10),
                                               static_cast<int>(pingu->get_y()),
-                                              GroundpieceData::GP_BRIDGE);
+                                              Groundtype::GP_BRIDGE);
       WorldObj::get_world()->get_gfx_map()->put(brick_l,
                                                static_cast<int>(pingu->get_x() 
- 10),
                                                
static_cast<int>(pingu->get_y()));

Index: climber.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/climber.cxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- climber.cxx 14 Sep 2002 19:06:33 -0000      1.11
+++ climber.cxx 16 Sep 2002 20:31:09 -0000      1.12
@@ -60,16 +60,16 @@
   sprite.update(delta);
 
   // If above is free
-  if (rel_getpixel(0, 1) ==  GroundpieceData::GP_NOTHING
-      || rel_getpixel (0, 1) ==  GroundpieceData::GP_BRIDGE)
+  if (rel_getpixel(0, 1) ==  Groundtype::GP_NOTHING
+      || rel_getpixel (0, 1) ==  Groundtype::GP_BRIDGE)
     {
       // and there is still ground to walk on
-      if (rel_getpixel(1, 1) !=  GroundpieceData::GP_NOTHING) 
+      if (rel_getpixel(1, 1) !=  Groundtype::GP_NOTHING) 
        {
          pingu->set_pos(pingu->get_y() - 1);
          return;
        }
-      else if (rel_getpixel(1, 1) ==  GroundpieceData::GP_NOTHING) 
+      else if (rel_getpixel(1, 1) ==  Groundtype::GP_NOTHING) 
        {
          //  std::cout << "Climber failed, no more wall" << std::endl;
 

Index: digger.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/digger.cxx,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- digger.cxx  14 Sep 2002 19:06:33 -0000      1.13
+++ digger.cxx  16 Sep 2002 20:31:09 -0000      1.14
@@ -70,9 +70,9 @@
 bool   
 Digger::have_something_to_dig ()
 {
-  if (rel_getpixel(0, -1) !=  GroundpieceData::GP_NOTHING)
+  if (rel_getpixel(0, -1) !=  Groundtype::GP_NOTHING)
     {
-      if (rel_getpixel(0, -1) ==  GroundpieceData::GP_SOLID)
+      if (rel_getpixel(0, -1) ==  Groundtype::GP_SOLID)
        {
          PingusSound::play_sound("sounds/chink.wav");
          return false;  

Index: faller.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/faller.cxx,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- faller.cxx  16 Sep 2002 16:47:41 -0000      1.23
+++ faller.cxx  16 Sep 2002 20:31:09 -0000      1.24
@@ -54,7 +54,7 @@
   faller.update (delta);
 
   // Pingu stands on ground
-  if (rel_getpixel(0, -1) !=  GroundpieceData::GP_NOTHING)
+  if (rel_getpixel(0, -1) !=  Groundtype::GP_NOTHING)
     { 
       pingu->set_action (Actions::Walker);
       return;
@@ -73,7 +73,7 @@
   
   // Update x and y by moving the penguin to it's target *slowly*
   // and checking if the penguin has hit the bottom at each loop
-  while(rel_getpixel(0, 0) == GroundpieceData::GP_NOTHING
+  while(rel_getpixel(0, 0) == Groundtype::GP_NOTHING
        && (fabs(newp.x) >= 1 || fabs(newp.y) >= 1))
     {
       last_pos = pingu->get_pos();
@@ -110,7 +110,7 @@
     }
 
   // Now that the Pingu is moved, check if he hits the ground.
-  if (rel_getpixel(0, 0) == GroundpieceData::GP_NOTHING)
+  if (rel_getpixel(0, 0) == Groundtype::GP_NOTHING)
     { // if pingu is not on ground
       ++falling;
          
@@ -119,7 +119,7 @@
     }
   else // Ping is on ground/water/something
     {
-      if (rel_getpixel(0, 0) == GroundpieceData::GP_WATER)
+      if (rel_getpixel(0, 0) == Groundtype::GP_WATER)
        {
          pingu->set_action(Actions::Drown);
          return;

Index: floater.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/floater.cxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- floater.cxx 14 Sep 2002 19:06:33 -0000      1.15
+++ floater.cxx 16 Sep 2002 20:31:09 -0000      1.16
@@ -19,7 +19,7 @@
 
 #include "../pingu.hxx"
 #include "../graphic_context.hxx"
-#include "../groundpiece_data.hxx"
+#include "../groundtype.hxx"
 #include "floater.hxx"
 
 namespace Actions {
@@ -43,7 +43,7 @@
   sprite.update (delta);
 
   pingu->set_velocity(CL_Vector(0.0, 0.0));
-  if (rel_getpixel(0, -1) == GroundpieceData::GP_NOTHING) {
+  if (rel_getpixel(0, -1) == Groundtype::GP_NOTHING) {
     ++step;
     if (step > 0) {
       pingu->set_y(pingu->get_y() + 1);

Index: miner.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/miner.cxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- miner.cxx   14 Sep 2002 19:06:33 -0000      1.11
+++ miner.cxx   16 Sep 2002 20:31:09 -0000      1.12
@@ -69,7 +69,7 @@
         pingu->set_pos(pingu->get_x() + pingu->direction, pingu->get_y() + 1);
       }
   
-    if (rel_getpixel(0, -1) ==  GroundpieceData::GP_NOTHING)
+    if (rel_getpixel(0, -1) ==  Groundtype::GP_NOTHING)
       {
         WorldObj::get_world()->get_colmap()->remove(miner_radius, 
                                                    
static_cast<int>(pingu->get_x() - 16 + pingu->direction),
@@ -79,7 +79,7 @@
                                                     
static_cast<int>(pingu->get_y() - 29));
         pingu->set_action(Actions::Walker);
       }
-    else if (rel_getpixel(0, -1) ==  GroundpieceData::GP_SOLID)
+    else if (rel_getpixel(0, -1) ==  Groundtype::GP_SOLID)
       {
         PingusSound::play_sound("sounds/chink.wav");
         WorldObj::get_world()->get_colmap ()->remove(miner_radius,

Index: slider.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/slider.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- slider.cxx  14 Sep 2002 19:06:33 -0000      1.9
+++ slider.cxx  16 Sep 2002 20:31:09 -0000      1.10
@@ -52,7 +52,7 @@
     {
       pingu->set_x(pingu->get_x() + pingu->direction);
       
-      if (rel_getpixel(0, -1) ==  GroundpieceData::GP_NOTHING)
+      if (rel_getpixel(0, -1) ==  Groundtype::GP_NOTHING)
        {
          speed = (speed > 5) ? 5 : speed;
 

Index: walker.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/walker.cxx,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- walker.cxx  14 Sep 2002 19:06:33 -0000      1.22
+++ walker.cxx  16 Sep 2002 20:31:09 -0000      1.23
@@ -61,7 +61,7 @@
   
   */
 
-  if (rel_getpixel(0, -1) ==  GroundpieceData::GP_WATER)
+  if (rel_getpixel(0, -1) ==  Groundtype::GP_WATER)
     {
       pingu->set_action(Actions::Drown);
       return;
@@ -69,7 +69,7 @@
 
   // The Pingu stands no longer on ground, the cause for this could be
   // a digger, miner or a bomber
-  if (rel_getpixel(0, -1) ==  GroundpieceData::GP_NOTHING)
+  if (rel_getpixel(0, -1) ==  Groundtype::GP_NOTHING)
     { 
       // We search for the nearest ground below the pingu, if we can't
       // find anything within a few pixels, we will turn into a faller
@@ -77,7 +77,7 @@
       int i;
       for (i = -2; i > -5; --i)
        {
-         if (!(rel_getpixel(0, i) == GroundpieceData::GP_NOTHING))
+         if (!(rel_getpixel(0, i) == Groundtype::GP_NOTHING))
            {
              found_ground = true;
              break;
@@ -97,7 +97,7 @@
 
   
   // FIXME: here we could/should scan more pixels
-  if (rel_getpixel(1, 0) == GroundpieceData::GP_BRIDGE
+  if (rel_getpixel(1, 0) == Groundtype::GP_BRIDGE
       && !head_collision_on_walk(1, 1))  // bridge
     {
       // simple, stupid, but working bridge code
@@ -122,9 +122,9 @@
       bool found_next_step = false;
       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)     == GroundpieceData::GP_BRIDGE) 
// FIXME: This causes a rather huge step
-             && rel_getpixel(1, y_inc - 1) != GroundpieceData::GP_NOTHING)
+         if ((   rel_getpixel(1, y_inc)     == Groundtype::GP_NOTHING
+                 || rel_getpixel(1, y_inc)     == Groundtype::GP_BRIDGE) // 
FIXME: This causes a rather huge step
+             && rel_getpixel(1, y_inc - 1) != Groundtype::GP_NOTHING)
            { // FIXME:
              found_next_step = true;
              possible_y_step = y_inc;
@@ -140,7 +140,7 @@
        }
       else
        {
-         if (rel_getpixel(1, 0) !=  GroundpieceData::GP_NOTHING)
+         if (rel_getpixel(1, 0) !=  Groundtype::GP_NOTHING)
            {
              // We reached a wall
              if (pingu->request_wall_action()) 





reply via email to

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