[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/actions faller.cxx,1.26,1.27 walker.c
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/actions faller.cxx,1.26,1.27 walker.cxx,1.25,1.26 |
Date: |
3 Oct 2002 00:47:07 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src/actions
In directory dark:/tmp/cvs-serv28777
Modified Files:
faller.cxx walker.cxx
Log Message:
- fixed ghost faller
Index: faller.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/faller.cxx,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- faller.cxx 1 Oct 2002 19:53:45 -0000 1.26
+++ faller.cxx 3 Oct 2002 00:47:05 -0000 1.27
@@ -69,15 +69,12 @@
pingu->set_velocity(ForcesHolder::apply_forces(pingu->get_pos(),
pingu->get_velocity()));
Vector newp = pingu->get_velocity();
- Vector last_pos;
// 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) == Groundtype::GP_NOTHING
+ while(rel_getpixel(0, -1) == Groundtype::GP_NOTHING
&& (fabs(newp.x) >= 1 || fabs(newp.y) >= 1))
{
- last_pos = pingu->get_pos();
-
if (fabs(newp.x) >= 1)
{
// Since the velocity might be a
@@ -110,7 +107,7 @@
}
// Now that the Pingu is moved, check if he hits the ground.
- if (rel_getpixel(0, 0) == Groundtype::GP_NOTHING)
+ if (rel_getpixel(0, -1) == Groundtype::GP_NOTHING)
{ // if pingu is not on ground
++falling;
@@ -119,7 +116,7 @@
}
else // Ping is on ground/water/something
{
- if (rel_getpixel(0, 0) == Groundtype::GP_WATER)
+ if (rel_getpixel(0, -1) == Groundtype::GP_WATER)
{
pingu->set_action(Actions::Drown);
return;
@@ -139,10 +136,6 @@
}
// Reset the velocity
pingu->set_velocity(Vector(-(pingu->get_velocity().x/3), 0));
- pingu->set_pos(last_pos);
-
- // FIXME: UGLY!
- //pingu->set_action (Walker);
}
}
Index: walker.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/walker.cxx,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- walker.cxx 1 Oct 2002 19:53:45 -0000 1.25
+++ walker.cxx 3 Oct 2002 00:47:05 -0000 1.26
@@ -102,7 +102,8 @@
{
// simple, stupid, but working bridge code
// FIXME: We don't check if we 'drift' into a solid ground block
- pingu->set_pos(pingu->get_x() + pingu->direction, pingu->get_y() - 1);
// pingus 'float' through bridges
+ pingu->set_pos(pingu->get_x() + pingu->direction,
+ pingu->get_y() - 1); // pingus 'float' through bridges
}
else
{
@@ -136,7 +137,8 @@
if (found_next_step)
{
// pos.y has a reversed co-system to rel_getpixel()?
- pingu->set_pos(pingu->get_x() + pingu->direction, pingu->get_y() -
possible_y_step);
+ pingu->set_pos(pingu->get_x() + pingu->direction,
+ pingu->get_y() - possible_y_step);
}
else
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/actions faller.cxx,1.26,1.27 walker.cxx,1.25,1.26,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src capture_rectangle.cxx,1.8,1.9 client.cxx,1.25,1.26 game_session.cxx,1.14,1.15 pingu.cxx,1.29,1.30 pingu.hxx,1.19,1.20 pingu_holder.cxx,1.11,1.12 pingu_holder.hxx,1.9,1.10 playfield.cxx,1.23,1.24 server.cxx,1.18,1.19 server.hxx,1.8,1.9
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src demo_session.cxx,NONE,1.1 demo_session.hxx,NONE,1.1 server_event.cxx,NONE,1.1 server_event.hxx,NONE,1.1 xml_pdf.cxx,NONE,1.1 xml_pdf.hxx,NONE,1.1 Makefile.am,1.112,1.113 action_button.cxx,1.13,1.14 demo_player.cxx,1.4,1.5 demo_player.hxx,1.5,1.6 demo_recorder.cxx,1.5,1.6 demo_recorder.hxx,1.5,1.6 game_session.hxx,1.10,1.11 pingu.cxx,1.30,1.31 pingu_holder.cxx,1.12,1.13 pingu_holder.hxx,1.10,1.11 pingus_main.cxx,1.20,1.21 server.cxx,1.19,1.20 server.hxx,1.9,1.10 true_server.cxx,1.13,1.14 true_server.hxx,1.8,1.9 xml_helper.cxx,1.21,1.22
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src capture_rectangle.cxx,1.8,1.9 client.cxx,1.25,1.26 game_session.cxx,1.14,1.15 pingu.cxx,1.29,1.30 pingu.hxx,1.19,1.20 pingu_holder.cxx,1.11,1.12 pingu_holder.hxx,1.9,1.10 playfield.cxx,1.23,1.24 server.cxx,1.18,1.19 server.hxx,1.8,1.9
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src demo_session.cxx,NONE,1.1 demo_session.hxx,NONE,1.1 server_event.cxx,NONE,1.1 server_event.hxx,NONE,1.1 xml_pdf.cxx,NONE,1.1 xml_pdf.hxx,NONE,1.1 Makefile.am,1.112,1.113 action_button.cxx,1.13,1.14 demo_player.cxx,1.4,1.5 demo_player.hxx,1.5,1.6 demo_recorder.cxx,1.5,1.6 demo_recorder.hxx,1.5,1.6 game_session.hxx,1.10,1.11 pingu.cxx,1.30,1.31 pingu_holder.cxx,1.12,1.13 pingu_holder.hxx,1.10,1.11 pingus_main.cxx,1.20,1.21 server.cxx,1.19,1.20 server.hxx,1.9,1.10 true_server.cxx,1.13,1.14 true_server.hxx,1.8,1.9 xml_helper.cxx,1.21,1.22
- Index(es):