From: Ingo Ruhnke Date: Sat, 24 Apr 2004 13:12:12 +0000 (+0000) Subject: - new star tux, still rather pure, but useable X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=8d35b07c0536394203ec46982c780e6ebd661cbe;p=supertux.git - new star tux, still rather pure, but useable SVN-Revision: 681 --- diff --git a/data/images/shared/largetux-grab-left-0.png b/data/images/shared/largetux-grab-left-0.png index 080f24f4f..e7a6c5b49 100644 Binary files a/data/images/shared/largetux-grab-left-0.png and b/data/images/shared/largetux-grab-left-0.png differ diff --git a/data/images/shared/largetux-grab-right-0.png b/data/images/shared/largetux-grab-right-0.png index 20bd3083c..21b63390c 100644 Binary files a/data/images/shared/largetux-grab-right-0.png and b/data/images/shared/largetux-grab-right-0.png differ diff --git a/data/images/shared/largetux-star-0.png b/data/images/shared/largetux-star-0.png new file mode 100644 index 000000000..2ce2aa5c9 Binary files /dev/null and b/data/images/shared/largetux-star-0.png differ diff --git a/data/images/shared/largetux-star-1.png b/data/images/shared/largetux-star-1.png new file mode 100644 index 000000000..5267b82f0 Binary files /dev/null and b/data/images/shared/largetux-star-1.png differ diff --git a/data/images/shared/largetux-star-2.png b/data/images/shared/largetux-star-2.png new file mode 100644 index 000000000..76acab787 Binary files /dev/null and b/data/images/shared/largetux-star-2.png differ diff --git a/data/images/shared/smalltux-star-0.png b/data/images/shared/smalltux-star-0.png new file mode 100644 index 000000000..c1a6c306f Binary files /dev/null and b/data/images/shared/smalltux-star-0.png differ diff --git a/data/images/shared/smalltux-star-1.png b/data/images/shared/smalltux-star-1.png new file mode 100644 index 000000000..6dd8edfd9 Binary files /dev/null and b/data/images/shared/smalltux-star-1.png differ diff --git a/data/images/shared/smalltux-star-2.png b/data/images/shared/smalltux-star-2.png new file mode 100644 index 000000000..0b0dafbe8 Binary files /dev/null and b/data/images/shared/smalltux-star-2.png differ diff --git a/data/supertux.strf b/data/supertux.strf index 9f1bb35a9..139ea4d28 100644 --- a/data/supertux.strf +++ b/data/supertux.strf @@ -325,6 +325,22 @@ (y-hotspot 1) (images "shared/largetux-grab-right-0.png")) + (sprite (name "largetux-star") + (x-hotspot 8) + (y-hotspot 8) + (images "shared/largetux-star-0.png" + "shared/largetux-star-1.png" + "shared/largetux-star-2.png" + )) + + (sprite (name "smalltux-star") + (x-hotspot 5) + (y-hotspot 15) + (images "shared/smalltux-star-0.png" + "shared/smalltux-star-1.png" + "shared/smalltux-star-2.png" + )) + ) ;; EOF ;; diff --git a/src/player.cpp b/src/player.cpp index 9f950c852..ec49ff4ab 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -44,6 +44,9 @@ Sprite* smalltux_kick_right; Sprite* smalltux_grab_left; Sprite* smalltux_grab_right; +Sprite* smalltux_star; +Sprite* largetux_star; + Sprite* largetux_kick_left; Sprite* largetux_kick_right; Sprite* largetux_grab_left; @@ -72,8 +75,6 @@ Surface* skidfiretux_right; Surface* skidfiretux_left; Surface* cape_right[2]; Surface* cape_left[2]; -Surface* bigcape_right[2]; -Surface* bigcape_left[2]; PlayerKeymap keymap; @@ -535,14 +536,6 @@ Player::draw() { if (size == SMALL) { - if (invincible_timer.started()) - { - if (dir == RIGHT) - cape_right[global_frame_counter % 2]->draw(base.x- scroll_x, base.y); - else - cape_left[global_frame_counter % 2]->draw(base.x- scroll_x, base.y); - } - if (!skidding_timer.started()) { if (physic.get_velocity_y() != 0) @@ -585,22 +578,12 @@ Player::draw() else smalltux_grab_left->draw(base.x - scroll_x, base.y); } + + if (invincible_timer.started()) + smalltux_star->draw(base.x - scroll_x, base.y); } else // Large Tux { - if (invincible_timer.started()) - { - float capex = base.x + (base.width - bigcape_right[0]->w) / 2; - capex -= scroll_x; - float capey = base.y + (base.height - bigcape_right[0]->h) / 2; - - /* Draw cape (just not in ducked mode since that looks silly): */ - if (dir == RIGHT) - bigcape_right[global_frame_counter % 2]->draw(capex, capey); - else - bigcape_left[global_frame_counter % 2]->draw(capex, capey); - } - if (!got_coffee) { if (!duck) @@ -694,6 +677,9 @@ Player::draw() else largetux_grab_left->draw(base.x - scroll_x, base.y); } + + if (invincible_timer.started()) + largetux_star->draw(base.x - scroll_x, base.y); } } } diff --git a/src/player.h b/src/player.h index 15291d38c..541f1795b 100644 --- a/src/player.h +++ b/src/player.h @@ -91,6 +91,8 @@ extern Sprite* smalltux_kick_left; extern Sprite* smalltux_kick_right; extern Sprite* smalltux_grab_left; extern Sprite* smalltux_grab_right; +extern Sprite* smalltux_star; +extern Sprite* largetux_star; extern Sprite* largetux_kick_left; extern Sprite* largetux_kick_right; diff --git a/src/resources.cpp b/src/resources.cpp index 8dce0ad5b..30707e637 100644 --- a/src/resources.cpp +++ b/src/resources.cpp @@ -46,6 +46,9 @@ void loadshared() sprite_manager = new SpriteManager(datadir + "/supertux.strf"); /* Tuxes: */ + smalltux_star = sprite_manager->load("smalltux-star"); + largetux_star = sprite_manager->load("largetux-star"); + smalltux_kick_left = sprite_manager->load("smalltux-kick-left"); smalltux_kick_right = sprite_manager->load("smalltux-kick-right"); smalltux_grab_left = sprite_manager->load("smalltux-grab-left"); @@ -117,18 +120,6 @@ void loadshared() bigtux_left_jump = sprite_manager->load("largetux-jump-left"); bigtux_right_jump = sprite_manager->load("largetux-jump-right"); - bigcape_right[0] = new Surface(datadir + "/images/shared/bigcape-right-0.png", - USE_ALPHA); - - bigcape_right[1] = new Surface(datadir + "/images/shared/bigcape-right-1.png", - USE_ALPHA); - - bigcape_left[0] = new Surface(datadir + "/images/shared/bigcape-left-0.png", - USE_ALPHA); - - bigcape_left[1] = new Surface(datadir + "/images/shared/bigcape-left-1.png", - USE_ALPHA); - bigfiretux_right[0] = new Surface(datadir + "/images/shared/bigfiretux-right-0.png", USE_ALPHA); @@ -151,19 +142,6 @@ void loadshared() bigfiretux_left_jump = new Surface(datadir + "/images/shared/bigfiretux-left-jump.png", USE_ALPHA); - bigcape_right[0] = new Surface(datadir + "/images/shared/bigcape-right-0.png", - USE_ALPHA); - - bigcape_right[1] = new Surface(datadir + "/images/shared/bigcape-right-1.png", - USE_ALPHA); - - bigcape_left[0] = new Surface(datadir + "/images/shared/bigcape-left-0.png", - USE_ALPHA); - - bigcape_left[1] = new Surface(datadir + "/images/shared/bigcape-left-1.png", - USE_ALPHA); - - ducktux_left = sprite_manager->load("largetux-duck-left"); ducktux_right = sprite_manager->load("largetux-duck-right"); @@ -322,8 +300,6 @@ void unloadshared(void) { delete cape_right[i]; delete cape_left[i]; - delete bigcape_right[i]; - delete bigcape_left[i]; } delete ducktux_left;