Index: ./Games/Pingus/src/pingu_enums.hxx =================================================================== RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu_enums.hxx,v retrieving revision 1.9 diff -u -r1.9 pingu_enums.hxx --- ./Games/Pingus/src/pingu_enums.hxx 2 Nov 2002 17:43:10 -0000 1.9 +++ ./Games/Pingus/src/pingu_enums.hxx 12 Jan 2003 22:41:03 -0000 @@ -68,6 +68,9 @@ } // namespace Actions +// Pingu "globals" +extern const int pingu_height; +extern const float deadly_velocity; #endif Index: ./Games/Pingus/src/pingu_enums.cxx =================================================================== RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu_enums.cxx,v retrieving revision 1.2 diff -u -r1.2 pingu_enums.cxx --- ./Games/Pingus/src/pingu_enums.cxx 25 Aug 2002 09:08:48 -0000 1.2 +++ ./Games/Pingus/src/pingu_enums.cxx 12 Jan 2003 22:41:03 -0000 @@ -19,6 +19,10 @@ #include "pingu_enums.hxx" +// Pingu "globals" +const int pingu_height = 26; +const float deadly_velocity = 20.0f; + namespace Actions { std::string action_to_string(ActionName action) { Index: ./Games/Pingus/src/pingu_action.hxx =================================================================== RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu_action.hxx,v retrieving revision 1.24 diff -u -r1.24 pingu_action.hxx --- ./Games/Pingus/src/pingu_action.hxx 3 Nov 2002 13:29:09 -0000 1.24 +++ ./Games/Pingus/src/pingu_action.hxx 12 Jan 2003 22:41:04 -0000 @@ -44,9 +44,6 @@ /** A pointer to the pingu, which hold the action. */ Pingu* pingu; - /// Height of Pingu. Used in head collision. - static const int pingu_height; - public: PinguAction(Pingu* p); virtual ~PinguAction(); Index: ./Games/Pingus/src/pingu_action.cxx =================================================================== RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu_action.cxx,v retrieving revision 1.21 diff -u -r1.21 pingu_action.cxx --- ./Games/Pingus/src/pingu_action.cxx 26 Nov 2002 21:30:37 -0000 1.21 +++ ./Games/Pingus/src/pingu_action.cxx 12 Jan 2003 22:41:05 -0000 @@ -28,10 +28,6 @@ #include "worldobj.hxx" #include "actions/faller.hxx" -// Initialise class static. -const int PinguAction::pingu_height = 26; -const float deadly_velocity = 20.0f; - PinguAction::PinguAction (Pingu* p) : pingu (p) { Index: ./Games/Pingus/src/Makefile.am =================================================================== RCS file: /usr/local/cvsroot/Games/Pingus/src/Makefile.am,v retrieving revision 1.124 diff -u -r1.124 Makefile.am --- ./Games/Pingus/src/Makefile.am 1 Dec 2002 17:45:21 -0000 1.124 +++ ./Games/Pingus/src/Makefile.am 12 Jan 2003 22:41:06 -0000 @@ -176,6 +176,7 @@ level_result.cxx \ level_result.hxx \ libxmlfwd.hxx \ +linear_mover.hxx \ loading.cxx \ loading.hxx \ main_menu.cxx \ @@ -183,6 +184,7 @@ math.hxx \ menu_background.cxx \ menu_background.hxx \ +mover.hxx \ multiline_text.cxx \ multiline_text.hxx \ my_gettext.hxx \ @@ -196,6 +198,8 @@ pingu_action.hxx \ pingu_action_factory.cxx \ pingu_action_factory.hxx \ +pingu_collider.cxx \ +pingu_collider.hxx \ pingu_enums.cxx \ pingu_enums.hxx \ pingu_holder.cxx \ @@ -286,6 +290,8 @@ timer.hxx \ true_server.cxx \ true_server.hxx \ +upright_pingu_collider.cxx \ +upright_pingu_collider.hxx \ vector.cxx \ vector.hxx \ view.cxx \ Index: ./Games/Pingus/src/actions/floater.cxx =================================================================== RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/floater.cxx,v retrieving revision 1.21 diff -u -r1.21 floater.cxx --- ./Games/Pingus/src/actions/floater.cxx 13 Oct 2002 20:25:00 -0000 1.21 +++ ./Games/Pingus/src/actions/floater.cxx 12 Jan 2003 22:41:07 -0000 @@ -38,7 +38,7 @@ { sprite.update (); - pingu->set_velocity(Vector(0.0, 0.0)); + pingu->set_velocity(Vector(0.0f, 1.0f)); if (rel_getpixel(0, -1) == Groundtype::GP_NOTHING) { Index: ./Games/Pingus/src/actions/faller.hxx =================================================================== RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/faller.hxx,v retrieving revision 1.17 diff -u -r1.17 faller.hxx --- ./Games/Pingus/src/actions/faller.hxx 3 Nov 2002 20:30:38 -0000 1.17 +++ ./Games/Pingus/src/actions/faller.hxx 12 Jan 2003 22:41:07 -0000 @@ -34,8 +34,6 @@ int falling; public: - static const float deadly_velocity; - Faller(Pingu*); virtual ~Faller(); Index: ./Games/Pingus/src/actions/faller.cxx =================================================================== RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/faller.cxx,v retrieving revision 1.34 diff -u -r1.34 faller.cxx --- ./Games/Pingus/src/actions/faller.cxx 3 Nov 2002 22:20:29 -0000 1.34 +++ ./Games/Pingus/src/actions/faller.cxx 12 Jan 2003 22:41:08 -0000 @@ -28,8 +28,6 @@ namespace Actions { -const float Faller::deadly_velocity = 20.0f; - Faller::Faller (Pingu* p) : PinguAction(p), faller(Sprite("Pingus/faller" + to_string(pingu->get_owner ()), "pingus")), Index: ./Games/Pingus/src/actions/bomber.cxx =================================================================== RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/bomber.cxx,v retrieving revision 1.25 diff -u -r1.25 bomber.cxx --- ./Games/Pingus/src/actions/bomber.cxx 3 Nov 2002 17:32:25 -0000 1.25 +++ ./Games/Pingus/src/actions/bomber.cxx 12 Jan 2003 22:41:09 -0000 @@ -23,11 +23,14 @@ #include "../globals.hxx" #include "../col_map.hxx" #include "../graphic_context.hxx" +#include "../linear_mover.hxx" #include "../pingu.hxx" #include "../pingu_map.hxx" #include "../pingus_resource.hxx" #include "../string_converter.hxx" #include "../world.hxx" +#include "../upright_pingu_collider.hxx" +#include "../vector.hxx" #include "../particles/particle_holder.hxx" #include "bomber.hxx" @@ -79,25 +82,33 @@ { sprite.update (); - // Do something according to the action that was in use before - 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; - } + LinearMover mover(WorldObj::get_world(), pingu->get_pos()); + + Vector velocity = pingu->get_velocity(); + + // Move the Pingu with different colliders depending on whether the Pingu is + // moving up (i.e. can go through Bridges) or moving down (i.e. can't go + // through Bridges) + if (velocity.y < 0.0f) + mover.update(velocity, UprightPinguCollider(false)); + else + mover.update(velocity, UprightPinguCollider(true)); + + pingu->set_pos(mover.get_pos()); // 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 || rel_getpixel(0, -1) == Groundtype::GP_LAVA)) { pingu->set_action(Actions::Drown); + return; + } + + // If the Bomber hasn't 'exploded' yet and it has hit the ground too quickly + if (sprite.get_frame () <= 9 && rel_getpixel(0, -1) != Groundtype::GP_NOTHING + && velocity.y > 20.0f) + { + pingu->set_action(Actions::Splashed); return; }