- added small/firetux to worldmap
authorIngo Ruhnke <grumbel@gmx.de>
Mon, 26 Apr 2004 13:38:48 +0000 (13:38 +0000)
committerIngo Ruhnke <grumbel@gmx.de>
Mon, 26 Apr 2004 13:38:48 +0000 (13:38 +0000)
SVN-Revision: 745

data/images/worldmap/firetux.png [new file with mode: 0644]
data/images/worldmap/smalltux.png [new file with mode: 0644]
src/worldmap.cpp
src/worldmap.h

diff --git a/data/images/worldmap/firetux.png b/data/images/worldmap/firetux.png
new file mode 100644 (file)
index 0000000..2629701
Binary files /dev/null and b/data/images/worldmap/firetux.png differ
diff --git a/data/images/worldmap/smalltux.png b/data/images/worldmap/smalltux.png
new file mode 100644 (file)
index 0000000..2fbcb02
Binary files /dev/null and b/data/images/worldmap/smalltux.png differ
index 3315727..366deb5 100644 (file)
@@ -165,7 +165,10 @@ TileManager::get(int i)
 Tux::Tux(WorldMap* worldmap_)
   : worldmap(worldmap_)
 {
-  sprite = new Surface(datadir +  "/images/worldmap/tux.png", USE_ALPHA);
+  largetux_sprite = new Surface(datadir +  "/images/worldmap/tux.png", USE_ALPHA);
+  firetux_sprite = new Surface(datadir +  "/images/worldmap/firetux.png", USE_ALPHA);
+  smalltux_sprite = new Surface(datadir +  "/images/worldmap/smalltux.png", USE_ALPHA);
+
   offset = 0;
   moving = false;
   tile_pos.x = 4;
@@ -176,15 +179,30 @@ Tux::Tux(WorldMap* worldmap_)
 
 Tux::~Tux()
 {
-  delete sprite;
+  delete smalltux_sprite;
+  delete firetux_sprite;
+  delete largetux_sprite;
 }
 
 void
 Tux::draw(const Point& offset)
 {
   Point pos = get_pos();
-  sprite->draw(pos.x + offset.x, 
-               pos.y + offset.y - 10);
+  switch (player_status.bonus)
+    {
+    case PlayerStatus::GROWUP_BONUS:
+      largetux_sprite->draw(pos.x + offset.x, 
+                            pos.y + offset.y - 10);
+      break;
+    case PlayerStatus::FLOWER_BONUS:
+      firetux_sprite->draw(pos.x + offset.x, 
+                           pos.y + offset.y - 10);
+      break;
+    case PlayerStatus::NO_BONUS:
+      smalltux_sprite->draw(pos.x + offset.x, 
+                            pos.y + offset.y - 10);
+      break;
+    }
 }
 
 
index 4c875c8..c2a7154 100644 (file)
@@ -95,7 +95,9 @@ public:
   Direction back_direction;
 private:
   WorldMap* worldmap;
-  Surface* sprite;
+  Surface* largetux_sprite;
+  Surface* firetux_sprite;
+  Surface* smalltux_sprite;
 
   Direction input_direction;
   Direction direction;