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 bomber.cxx,1.23,1.24 bomber.h


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/actions bomber.cxx,1.23,1.24 bomber.hxx,1.16,1.17
Date: 3 Nov 2002 14:37:22 -0000

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

Modified Files:
        bomber.cxx bomber.hxx 
Log Message:
if you can't fix it, remove it... bye,bye forces_vector

Index: bomber.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/bomber.cxx,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- bomber.cxx  3 Nov 2002 13:29:09 -0000       1.23
+++ bomber.cxx  3 Nov 2002 14:37:20 -0000       1.24
@@ -22,7 +22,6 @@
 #include "../debug.hxx"
 #include "../globals.hxx"
 #include "../col_map.hxx"
-#include "../force_vector.hxx"
 #include "../graphic_context.hxx"
 #include "../pingu.hxx"
 #include "../pingu_map.hxx"
@@ -80,8 +79,18 @@
 {
   sprite.update ();
 
-  if (pingu->get_previous_action() == Actions::Faller)
-    move_with_forces();
+  switch (pingu->get_previous_action())
+    {
+    case Actions::Faller:
+      move_with_forces();
+      break;
+    case Actions::Floater:
+      if (rel_getpixel(0, -1) == Groundtype::GP_NOTHING)
+        pingu->set_y(pingu->get_y() + 0.5f);
+      break;
+    default:
+      break;
+    }
 
   // If the Bomber hasn't 'exploded' yet and it has hit Water or Lava
   if (sprite.get_frame () <= 9 && (rel_getpixel(0, -1) == Groundtype::GP_WATER
@@ -114,11 +123,7 @@
                                                  static_cast<int>(pingu->get_y 
() - 16 - (bomber_radius.get_width()/2)));
       WorldObj::get_world()->get_gfx_map()->remove(bomber_radius_gfx, 
                                                   
static_cast<int>(pingu->get_x () - (bomber_radius.get_width()/2)),
-                                                  
static_cast<int>(pingu->get_y () - 16 - (bomber_radius.get_width()/2)));
-      
-      // Add an explosion to the forces list
-      ForcesHolder::add_force(ExplosionForce(5,30,Vector(pingu->get_x (),
-                                                           pingu->get_y () - 
20)));
+                                                  
static_cast<int>(pingu->get_y () - 16 - (bomber_radius.get_width()/2)));    
     }
 
 
@@ -127,14 +132,6 @@
     {
       pingu->set_status(PS_DEAD);
     }
-}
-
-void
-Bomber::update_position ()
-{
-  // Apply all forces
-  pingu->set_velocity(ForcesHolder::apply_forces(pingu->get_pos(), 
pingu->get_velocity()));
-  pingu->set_pos(pingu->get_pos() + pingu->get_velocity());
 }
 
 } // namespace Actions

Index: bomber.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/bomber.hxx,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- bomber.hxx  13 Oct 2002 20:25:00 -0000      1.16
+++ bomber.hxx  3 Nov 2002 14:37:20 -0000       1.17
@@ -52,7 +52,6 @@
   void draw (GraphicContext& gc);
   void update();
 
-  void update_position();
   int  activation_time() { return 50; }
   void on_successfull_apply ();
   





reply via email to

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