[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/worldmap pingus.cxx,1.28,1.29 pingus
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/worldmap pingus.cxx,1.28,1.29 pingus.hxx,1.23,1.24 |
Date: |
27 Mar 2003 16:42:32 -0000 |
Update of /var/lib/cvs/Games/Pingus/src/worldmap
In directory dark:/tmp/cvs-serv10774/src/worldmap
Modified Files:
pingus.cxx pingus.hxx
Log Message:
- added small-pingu sprite to the worldmap, not perfect, but better than the
last one
Index: pingus.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/worldmap/pingus.cxx,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- pingus.cxx 25 Mar 2003 00:37:44 -0000 1.28
+++ pingus.cxx 27 Mar 2003 16:42:30 -0000 1.29
@@ -29,7 +29,8 @@
Pingus::Pingus (PathGraph* arg_path)
: Drawable("pingus"),
path(arg_path),
- sprite ("Pingus/walker0", "pingus", 20.0f, Sprite::RIGHT),
+ sprite ("worldmap/pingus", "core", 20.0f, Sprite::RIGHT),
+ sprite_standing ("worldmap/pingus_standing", "core"),
arrow ("worldmap/arrow", "core")
{
arrow.set_align_center_bottom();
@@ -37,7 +38,9 @@
pos.x = 320;
pos.y = 200;
- sprite.set_align (-sprite.get_width()/2, 4 - sprite.get_height());
+ sprite.set_align (-sprite.get_width()/2, 2 - sprite.get_height());
+ sprite_standing.set_align (-sprite_standing.get_width()/2,
+ -sprite_standing.get_height());
}
Pingus::~Pingus ()
@@ -48,10 +51,7 @@
void
Pingus::draw (GraphicContext& gc)
{
- // FIXME: Our sprite class is quite a bit sucky...
- if (!is_walking())
- sprite.set_frame(5);
- else
+ if (final_target_node != NoNode && current_node == NoNode)
{
gc.draw(arrow, path->get_dot(final_target_node)->get_pos());
}
@@ -62,7 +62,11 @@
sprite.set_direction(Sprite::RIGHT);
else
sprite.set_direction(Sprite::LEFT);
- gc.draw(sprite, pos);
+
+ if (!is_walking())
+ gc.draw(sprite_standing, pos);
+ else
+ gc.draw(sprite, pos);
}
void
@@ -89,6 +93,7 @@
if (node_path.empty ()) // final target reached
{
current_node = target_node;
+ final_target_node = NoNode;
}
else // edge is traveled, now go to the next node
{
Index: pingus.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/worldmap/pingus.hxx,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- pingus.hxx 21 Mar 2003 22:08:06 -0000 1.23
+++ pingus.hxx 27 Mar 2003 16:42:30 -0000 1.24
@@ -34,6 +34,7 @@
private:
PathGraph* path;
Sprite sprite;
+ Sprite sprite_standing;
Sprite arrow;
/** The node on which the pingu currently stands, NoNode if the pingu is
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/worldmap pingus.cxx,1.28,1.29 pingus.hxx,1.23,1.24,
grumbel <=