[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/actions walker.cxx,1.31,1.32 walker.
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/actions walker.cxx,1.31,1.32 walker.hxx,1.11,1.12 |
Date: |
4 Mar 2003 11:26:24 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src/actions
In directory dark:/tmp/cvs-serv11247/src/actions
Modified Files:
walker.cxx walker.hxx
Log Message:
added visual indicator for floater
Index: walker.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/walker.cxx,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- walker.cxx 19 Feb 2003 09:50:36 -0000 1.31
+++ walker.cxx 4 Mar 2003 11:26:18 -0000 1.32
@@ -29,9 +29,11 @@
Walker::Walker (Pingu* p)
: PinguAction(p),
- walker("Pingus/walker" + to_string(pingu->get_owner()), "pingus", 15.0f)
+ walker("Pingus/walker" + to_string(pingu->get_owner()), "pingus", 15.0f),
+ floaterlayer("Pingus/floaterlayer", "pingus", 15.0f)
{
walker.set_align_center_bottom();
+ floaterlayer.set_align_center_bottom();
// Reset the velocity
pingu->set_velocity(Vector());
@@ -42,6 +44,7 @@
{
// update the sprite
walker.update();
+ floaterlayer.update();
Vector last_pos = pingu->get_pos();
@@ -124,7 +127,7 @@
for (y_inc = -max_steps; y_inc <= max_steps; ++y_inc)
{// up/down-hill scan
if (( rel_getpixel(1, y_inc) == Groundtype::GP_NOTHING
- || rel_getpixel(1, y_inc) == Groundtype::GP_BRIDGE) //
FIXME: This causes a rather huge step
+ || rel_getpixel(1, y_inc) == Groundtype::GP_BRIDGE) //
FIXME: This causes a rather huge step
&& rel_getpixel(1, y_inc - 1) != Groundtype::GP_NOTHING)
{ // FIXME:
found_next_step = true;
@@ -202,11 +205,22 @@
Walker::draw (GraphicContext& gc)
{
if (pingu->direction.is_left())
- walker.set_direction(Sprite::LEFT);
+ {
+ walker.set_direction(Sprite::LEFT);
+ floaterlayer.set_direction(Sprite::LEFT);
+ }
else
- walker.set_direction(Sprite::RIGHT);
+ {
+ walker.set_direction(Sprite::RIGHT);
+ floaterlayer.set_direction(Sprite::RIGHT);
+ }
gc.draw (walker, pingu->get_pos() + Vector (0, +2));
+
+ if (pingu->get_fall_action() && pingu->get_fall_action()->get_type() ==
Actions::Floater)
+ {
+ gc.draw(floaterlayer, pingu->get_pos() + Vector(0, +2));
+ }
}
} // namespace Actions
Index: walker.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/walker.hxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- walker.hxx 13 Oct 2002 16:40:01 -0000 1.11
+++ walker.hxx 4 Mar 2003 11:26:18 -0000 1.12
@@ -29,6 +29,7 @@
{
private:
Sprite walker;
+ Sprite floaterlayer;
enum { max_steps = 5 }; // max nr. of pixels that pingu can walk up/down
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/actions walker.cxx,1.31,1.32 walker.hxx,1.11,1.12,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/contrib/animtest animtest.cxx,1.1,1.2
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/data/levels/playable basher-tutorial-grumbel.xml,1.2,1.3 miner-tutorial2-grumbel.xml,1.1,1.2 snow11-grumbel.xml,1.1,1.2 snow15-grumbel.xml,1.2,1.3
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/contrib/animtest animtest.cxx,1.1,1.2
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/data/levels/playable basher-tutorial-grumbel.xml,1.2,1.3 miner-tutorial2-grumbel.xml,1.1,1.2 snow11-grumbel.xml,1.1,1.2 snow15-grumbel.xml,1.2,1.3
- Index(es):