From: Ingo Ruhnke Date: Mon, 26 Apr 2004 13:38:48 +0000 (+0000) Subject: - added small/firetux to worldmap X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=599adb53dbdfdcc4ac4e4dfab1e0868ff0412110;p=supertux.git - added small/firetux to worldmap SVN-Revision: 745 --- diff --git a/data/images/worldmap/firetux.png b/data/images/worldmap/firetux.png new file mode 100644 index 000000000..2629701d7 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 index 000000000..2fbcb021f Binary files /dev/null and b/data/images/worldmap/smalltux.png differ diff --git a/src/worldmap.cpp b/src/worldmap.cpp index 331572726..366deb50e 100644 --- a/src/worldmap.cpp +++ b/src/worldmap.cpp @@ -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; + } } diff --git a/src/worldmap.h b/src/worldmap.h index 4c875c8bb..c2a7154a8 100644 --- a/src/worldmap.h +++ b/src/worldmap.h @@ -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;