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.6,1.7 basher.hxx


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/actions basher.cxx,1.6,1.7 basher.hxx,1.2,1.3 bomber.cxx,1.2,1.3 bomber.hxx,1.2,1.3
Date: 26 Jun 2002 15:38:46 -0000

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

Modified Files:
        basher.cxx basher.hxx bomber.cxx bomber.hxx 
Log Message:
synced the explo surface display with the groundmap removal in the bomber


Index: basher.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/basher.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- basher.cxx  25 Jun 2002 18:15:18 -0000      1.6
+++ basher.cxx  26 Jun 2002 15:38:44 -0000      1.7
@@ -39,8 +39,13 @@
 {
   first_bash = true;
   bash_radius = PingusResource::load_surface ("Other/bash_radius", "pingus");
+  bash_radius_gfx = PingusResource::load_surface ("Other/bash_radius_gfx", 
"pingus");
   sprite = Sprite (PingusResource::load_surface ("Pingus/basher0", "pingus"));
   sprite.set_align_center_bottom ();
+
+  // Start a bash even so the action will stops instantly after the
+  // first bash
+  bash ();
 }
 
 void
@@ -82,9 +87,11 @@
 Basher::bash()
 {
   pingu->get_world()->get_colmap()->remove(bash_radius,
-                                          pingu->get_x () - 
(bash_radius.get_width()/2), pingu->get_y () - 31);
-  pingu->get_world()->get_gfx_map()->remove(bash_radius,
-                                           pingu->get_x () - 
(bash_radius.get_width()/2), pingu->get_y () - 31);
+                                          pingu->get_x () - 
(bash_radius.get_width()/2),
+                                          pingu->get_y () - 31);
+  pingu->get_world()->get_gfx_map()->remove(bash_radius_gfx,
+                                           pingu->get_x () - 
(bash_radius_gfx.get_width()/2),
+                                           pingu->get_y () - 31);
 }
 
 void

Index: basher.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/basher.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- basher.hxx  24 Jun 2002 22:52:57 -0000      1.2
+++ basher.hxx  26 Jun 2002 15:38:44 -0000      1.3
@@ -29,6 +29,7 @@
 private:
   Sprite sprite;
   CL_Surface bash_radius;
+  CL_Surface bash_radius_gfx;
   int basher_c;
   bool first_bash;
 public:

Index: bomber.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/bomber.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- bomber.cxx  19 Jun 2002 15:19:26 -0000      1.2
+++ bomber.cxx  26 Jun 2002 15:38:44 -0000      1.3
@@ -33,16 +33,17 @@
 CL_Surface Bomber::bomber_radius;
 CL_Surface Bomber::bomber_radius_gfx;
 
-Bomber::Bomber() : particle_thrown(false), sound_played(false), exploded(false)
+Bomber::Bomber() 
+  : particle_thrown(false),
+    sound_played(false), 
+    gfx_exploded(false),
+    colmap_exploded(false)
 {
 }
 
 void
 Bomber::init()
 {
-  particle_thrown = false;
-  exploded = false;
-  
   // Only load the surface again if no static_surface is available
   if (!static_surface_loaded) 
     {
@@ -62,10 +63,10 @@
 void
 Bomber::draw_offset(int x, int y, float /*s*/)
 {
-  if (sprite.get_frame () >= 13 && !exploded) 
+  if (sprite.get_frame () >= 13 && !gfx_exploded) 
     {
       explo_surf.put_screen(pingu->get_x () - 32 + x, pingu->get_y () - 48 + 
y);
-      exploded = true;
+      gfx_exploded = true;
     }
 
   sprite.put_screen(pingu->get_x () + x, pingu->get_y () + y);
@@ -88,10 +89,11 @@
       pingu->get_world()->get_particle_holder()->add_pingu_explo(pingu->get_x 
(), pingu->get_y () - 5);
     }
 
-  // The pingu explode
-  if (sprite.finished ())
+
+  if (sprite.get_frame () >= 13 && !colmap_exploded)
     {
-      pingu->set_status(PS_DEAD);
+      colmap_exploded = true;
+
       pingu->get_world()->get_colmap()->remove(bomber_radius,
                                               pingu->get_x () - 
(bomber_radius.get_width()/2),
                                               pingu->get_y () - 16 - 
(bomber_radius.get_width()/2));
@@ -102,6 +104,13 @@
       // Add an explosion to the forces list
       ForcesHolder::add_force(ExplosionForce(5,30,CL_Vector(pingu->get_x (),
                                                             pingu->get_y () - 
20)));
+    }
+
+
+  // The pingu explode
+  if (sprite.finished ())
+    {
+      pingu->set_status(PS_DEAD);
     }
 }
 

Index: bomber.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/bomber.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- bomber.hxx  24 Jun 2002 22:52:57 -0000      1.2
+++ bomber.hxx  26 Jun 2002 15:38:44 -0000      1.3
@@ -32,7 +32,8 @@
   bool particle_thrown;
   ///
   bool sound_played;
-  bool exploded; 
+  bool gfx_exploded; 
+  bool colmap_exploded; 
   ///
   static bool static_surface_loaded;
   Sprite sprite;




reply via email to

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