[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src pingu_action.cxx,1.11,1.12
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src pingu_action.cxx,1.11,1.12 |
Date: |
2 Nov 2002 17:13:58 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src
In directory dark:/tmp/cvs-serv26976
Modified Files:
pingu_action.cxx
Log Message:
bounce of jumper is back
Index: pingu_action.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu_action.cxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- pingu_action.cxx 28 Oct 2002 15:41:42 -0000 1.11
+++ pingu_action.cxx 2 Nov 2002 17:13:56 -0000 1.12
@@ -161,18 +161,13 @@
// If there is something to the right of the Pingu
if (collision_on_walk(pingu->direction, 0))
{
- // Make it so that the Pingu won't go right any further.
- force_counter.x = 0;
- resultant_force.x = 0;
-
- // Stop Pingu from still going up
- if (force_counter.y < 0)
- {
- force_counter.y = 0;
- resultant_force.y = 0;
- }
+ // Make the Pingu reflect/bounce off the wall
+ force_counter.x = -(force_counter.x);
+ resultant_force.x = -(resultant_force.x/3);
pingu->set_velocity(resultant_force);
+
+ pingu->direction.change();
}
else
{
@@ -186,18 +181,13 @@
// If there is something to the left of the Pingu
if (collision_on_walk(-(pingu->direction), 0))
{
- // Make it so that the Pingu won't go left any further.
- force_counter.x = 0;
- resultant_force.x = 0;
-
- // Stop Pingu from still going up
- if (force_counter.y < 0)
- {
- force_counter.y = 0;
- resultant_force.y = 0;
- }
+ // Make the Pingu reflect off the wall
+ force_counter.x = -(force_counter.x);
+ resultant_force.x = -(resultant_force.x);
pingu->set_velocity(resultant_force);
+
+ pingu->direction.change();
}
else
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src pingu_action.cxx,1.11,1.12,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/data/levels jumper-tutorial-grumbel.xml,1.1,1.2
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src button_panel.cxx,1.18,1.19 pingu_enums.hxx,1.8,1.9
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/data/levels jumper-tutorial-grumbel.xml,1.1,1.2
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src button_panel.cxx,1.18,1.19 pingu_enums.hxx,1.8,1.9
- Index(es):