From: Christoph Sommer Date: Wed, 8 Mar 2006 11:46:45 +0000 (+0000) Subject: Moved powerups to separate .sprite files X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=b158cdbc7139bcc35fd4c37a5cf640bf9f744998;p=supertux.git Moved powerups to separate .sprite files SVN-Revision: 3079 --- diff --git a/data/Jamfile b/data/Jamfile index 07bbf5c84..32fab8c14 100644 --- a/data/Jamfile +++ b/data/Jamfile @@ -24,8 +24,8 @@ IMAGEPATHS = images/powerups/1up images/powerups/egg images/powerups/star - images/powerups/ice_flower - images/powerups/fire_flower + images/powerups/iceflower + images/powerups/fireflower images/engine images/engine/menu images/engine/fonts diff --git a/data/images/powerups/1up/1up.sprite b/data/images/powerups/1up/1up.sprite new file mode 100644 index 000000000..8b540f66a --- /dev/null +++ b/data/images/powerups/1up/1up.sprite @@ -0,0 +1,3 @@ +(supertux-sprite + (action + (images "1up.png"))) diff --git a/data/images/powerups/egg/egg.sprite b/data/images/powerups/egg/egg.sprite new file mode 100644 index 000000000..de0d0f83b --- /dev/null +++ b/data/images/powerups/egg/egg.sprite @@ -0,0 +1,3 @@ +(supertux-sprite + (action + (images "egg.png"))) diff --git a/data/images/powerups/fire_flower/fire_flower-0.png b/data/images/powerups/fire_flower/fire_flower-0.png deleted file mode 100644 index b6d6f6784..000000000 Binary files a/data/images/powerups/fire_flower/fire_flower-0.png and /dev/null differ diff --git a/data/images/powerups/fire_flower/fire_flower-1.png b/data/images/powerups/fire_flower/fire_flower-1.png deleted file mode 100644 index 86424ed92..000000000 Binary files a/data/images/powerups/fire_flower/fire_flower-1.png and /dev/null differ diff --git a/data/images/powerups/fire_flower/fire_flower-2.png b/data/images/powerups/fire_flower/fire_flower-2.png deleted file mode 100644 index f88bc7155..000000000 Binary files a/data/images/powerups/fire_flower/fire_flower-2.png and /dev/null differ diff --git a/data/images/powerups/fire_flower/fire_flower-3.png b/data/images/powerups/fire_flower/fire_flower-3.png deleted file mode 100644 index 205b87faf..000000000 Binary files a/data/images/powerups/fire_flower/fire_flower-3.png and /dev/null differ diff --git a/data/images/powerups/fireflower/fire_flower-0.png b/data/images/powerups/fireflower/fire_flower-0.png new file mode 100644 index 000000000..b6d6f6784 Binary files /dev/null and b/data/images/powerups/fireflower/fire_flower-0.png differ diff --git a/data/images/powerups/fireflower/fire_flower-1.png b/data/images/powerups/fireflower/fire_flower-1.png new file mode 100644 index 000000000..86424ed92 Binary files /dev/null and b/data/images/powerups/fireflower/fire_flower-1.png differ diff --git a/data/images/powerups/fireflower/fire_flower-2.png b/data/images/powerups/fireflower/fire_flower-2.png new file mode 100644 index 000000000..f88bc7155 Binary files /dev/null and b/data/images/powerups/fireflower/fire_flower-2.png differ diff --git a/data/images/powerups/fireflower/fire_flower-3.png b/data/images/powerups/fireflower/fire_flower-3.png new file mode 100644 index 000000000..205b87faf Binary files /dev/null and b/data/images/powerups/fireflower/fire_flower-3.png differ diff --git a/data/images/powerups/fireflower/fireflower.sprite b/data/images/powerups/fireflower/fireflower.sprite new file mode 100644 index 000000000..65980bcdd --- /dev/null +++ b/data/images/powerups/fireflower/fireflower.sprite @@ -0,0 +1,8 @@ +(supertux-sprite + (action + (images "fire_flower-0.png" + "fire_flower-1.png" + "fire_flower-2.png" + "fire_flower-3.png" + "fire_flower-2.png" + "fire_flower-1.png"))) diff --git a/data/images/powerups/ice_flower/ice_flower-0.png b/data/images/powerups/ice_flower/ice_flower-0.png deleted file mode 100644 index d5735fc69..000000000 Binary files a/data/images/powerups/ice_flower/ice_flower-0.png and /dev/null differ diff --git a/data/images/powerups/ice_flower/ice_flower-1.png b/data/images/powerups/ice_flower/ice_flower-1.png deleted file mode 100644 index 6d48ad5fe..000000000 Binary files a/data/images/powerups/ice_flower/ice_flower-1.png and /dev/null differ diff --git a/data/images/powerups/ice_flower/ice_flower-2.png b/data/images/powerups/ice_flower/ice_flower-2.png deleted file mode 100644 index 57105344a..000000000 Binary files a/data/images/powerups/ice_flower/ice_flower-2.png and /dev/null differ diff --git a/data/images/powerups/iceflower/ice_flower-0.png b/data/images/powerups/iceflower/ice_flower-0.png new file mode 100644 index 000000000..d5735fc69 Binary files /dev/null and b/data/images/powerups/iceflower/ice_flower-0.png differ diff --git a/data/images/powerups/iceflower/ice_flower-1.png b/data/images/powerups/iceflower/ice_flower-1.png new file mode 100644 index 000000000..6d48ad5fe Binary files /dev/null and b/data/images/powerups/iceflower/ice_flower-1.png differ diff --git a/data/images/powerups/iceflower/ice_flower-2.png b/data/images/powerups/iceflower/ice_flower-2.png new file mode 100644 index 000000000..57105344a Binary files /dev/null and b/data/images/powerups/iceflower/ice_flower-2.png differ diff --git a/data/images/powerups/iceflower/iceflower.sprite b/data/images/powerups/iceflower/iceflower.sprite new file mode 100644 index 000000000..4216ccd33 --- /dev/null +++ b/data/images/powerups/iceflower/iceflower.sprite @@ -0,0 +1,5 @@ +(supertux-sprite + (action + (images "ice_flower-0.png" + "ice_flower-1.png" + "ice_flower-2.png"))) diff --git a/data/images/powerups/star/star.sprite b/data/images/powerups/star/star.sprite new file mode 100644 index 000000000..c0da3faa1 --- /dev/null +++ b/data/images/powerups/star/star.sprite @@ -0,0 +1,10 @@ +(supertux-sprite + (action + (images "star-0.png" + "star-1.png" + "star-2.png" + "star-3.png" + "star-4.png" + "star-3.png" + "star-2.png" + "star-1.png"))) diff --git a/data/images/sprites.strf b/data/images/sprites.strf index 145c17ed6..fc824cd49 100644 --- a/data/images/sprites.strf +++ b/data/images/sprites.strf @@ -5,37 +5,7 @@ ;; Bad Guys are in separate .sprite files -;; Game elements follow - - (sprite (name "egg") - (action - (images "powerups/egg/egg.png"))) - (sprite (name "1up") - (action - (images "powerups/1up/1up.png"))) - (sprite (name "star") - (action - (images "powerups/star/star-0.png" - "powerups/star/star-1.png" - "powerups/star/star-2.png" - "powerups/star/star-3.png" - "powerups/star/star-4.png" - "powerups/star/star-3.png" - "powerups/star/star-2.png" - "powerups/star/star-1.png"))) - (sprite (name "fireflower") - (action - (images "powerups/fire_flower/fire_flower-0.png" - "powerups/fire_flower/fire_flower-1.png" - "powerups/fire_flower/fire_flower-2.png" - "powerups/fire_flower/fire_flower-3.png" - "powerups/fire_flower/fire_flower-2.png" - "powerups/fire_flower/fire_flower-1.png"))) - (sprite (name "iceflower") - (action - (images "powerups/ice_flower/ice_flower-0.png" - "powerups/ice_flower/ice_flower-1.png" - "powerups/ice_flower/ice_flower-2.png"))) +;; Game elements are in separate .sprite files ;; Game Objects follow diff --git a/data/levels/test/bonusblock.stl b/data/levels/test/bonusblock.stl index d2c8dca29..73189d05b 100644 --- a/data/levels/test/bonusblock.stl +++ b/data/levels/test/bonusblock.stl @@ -133,7 +133,7 @@ (image "images/background/arctis.jpg") (speed 0.500000) ) - (powerup (x 135) (y 600) (sprite "egg")) + (powerup (x 135) (y 600) (sprite "images/powerups/egg/egg.sprite")) (spawnpoint (name "main") (x 33) (y 160)) (infoblock (x 128) (y 800) (message (_ "-Info diff --git a/data/levels/test/enemy3.stl b/data/levels/test/enemy3.stl index d1f4fe899..54366d189 100644 --- a/data/levels/test/enemy3.stl +++ b/data/levels/test/enemy3.stl @@ -79,10 +79,10 @@ (mriceblock (x 439) (y 159) (stay-on-platform #t)) (mriceblock (x 479) (y 159) (stay-on-platform #f)) (zeekling (x 1000) (y 140)) - (powerup (x 900) (y 140) (sprite "star")) - (powerup (x 940) (y 140) (sprite "fireflower")) - (powerup (x 980) (y 140) (sprite "egg")) - (powerup (x 1020) (y 140) (sprite "1up")) + (powerup (x 900) (y 140) (sprite "images/powerups/star/star.sprite")) + (powerup (x 940) (y 140) (sprite "images/powerups/fireflower/fireflower.sprite")) + (powerup (x 980) (y 140) (sprite "images/powerups/egg/egg.sprite")) + (powerup (x 1020) (y 140) (sprite "images/powerups/1up/1up.sprite")) (powerup (x 1400) (y 140) (sprite "images/powerups/potions/red-potion.sprite") (contents "custom") diff --git a/data/levels/test/platform.stl b/data/levels/test/platform.stl index 9bee19806..62594af82 100644 --- a/data/levels/test/platform.stl +++ b/data/levels/test/platform.stl @@ -140,7 +140,7 @@ (platform (use_path "path2") (x 424) (y 650) (type "block2")) (platform (use_path "path1") (x 456) (y 850) (type "block2")) (platform (use_path "path1") (x 488) (y 850) (type "block3")) - (powerup (x 100) (y 700) (sprite "egg")) + (powerup (x 100) (y 700) (sprite "images/powerups/egg/egg.sprite")) (jumpy (x 140) (y 750)) (spawnpoint (name "main") (x 340) (y 800)) ) diff --git a/data/levels/test/raintest.stl b/data/levels/test/raintest.stl index a7b5d4a80..81cc5ec34 100644 --- a/data/levels/test/raintest.stl +++ b/data/levels/test/raintest.stl @@ -201,7 +201,7 @@ (bonusblock (x 160) (y 160) (contents "custom") (powerup - (sprite "images/powerups/potions/images/powerups/potions/red-potion.sprite.sprite") + (sprite "images/powerups/potions/red-potion.sprite") (script " function wait(time) { set_wakeup_time(time); diff --git a/data/levels/world1/cs.po b/data/levels/world1/cs.po index ce7db593c..5423817b3 100644 --- a/data/levels/world1/cs.po +++ b/data/levels/world1/cs.po @@ -168,7 +168,7 @@ msgid "" "#The egg makes Tux grow\n" "#larger.\n" "\n" -"!images/powerups/fire_flower/fire_flower-0.png\n" +"!images/powerups/fireflower/fire_flower-0.png\n" "#The fire flower gives\n" "#Tux the ability to\n" "#shoot fireballs.\n" @@ -193,7 +193,7 @@ msgstr "" "!images/powerups/egg/egg.png\n" "#Vejce Tuxe nechá vyrůst.\n" "\n" -"!images/powerups/fire_flower/fire_flower-0.png\n" +"!images/powerups/fireflower/fire_flower-0.png\n" "#Ohnivá květina dá Tuxovi\n" "#schopnost střílení\n" "#ohnivých koulí.\n" diff --git a/data/levels/world1/level1.stl b/data/levels/world1/level1.stl index 64a21aaa0..3b064bcea 100644 --- a/data/levels/world1/level1.stl +++ b/data/levels/world1/level1.stl @@ -129,7 +129,7 @@ #The egg makes Tux grow #larger. -!images/powerups/fire_flower/fire_flower-0.png +!images/powerups/fireflower/fire_flower-0.png #The fire flower gives #Tux the ability to #shoot fireballs. diff --git a/data/levels/world2/level1.stl b/data/levels/world2/level1.stl index d233e53b8..ff8770563 100644 --- a/data/levels/world2/level1.stl +++ b/data/levels/world2/level1.stl @@ -426,7 +426,7 @@ (distance_bias 100.0) (volume 1)) (powerup (x 192) (y 2496) - (sprite "fireflower") + (sprite "images/powerups/fireflower/fireflower.sprite") ) (zeekling (x 1614) (y 665)) (zeekling (x 3744) (y 779)) diff --git a/src/badguy/angrystone.cpp b/src/badguy/angrystone.cpp index ff7c86257..a3eb78122 100644 --- a/src/badguy/angrystone.cpp +++ b/src/badguy/angrystone.cpp @@ -33,7 +33,7 @@ AngryStone::AngryStone(const lisp::Lisp& reader) reader.get("x", start_position.x); reader.get("y", start_position.y); bbox.set_size(87.8, 87.8); // sprite is (88px, 88px) - sprite = sprite_manager->create("angrystone"); + sprite = sprite_manager->create("images/creatures/angrystone/angrystone.sprite"); state = IDLE; } diff --git a/src/badguy/snowball.cpp b/src/badguy/snowball.cpp index f3f0a5e5c..8da2e7083 100644 --- a/src/badguy/snowball.cpp +++ b/src/badguy/snowball.cpp @@ -32,7 +32,7 @@ SnowBall::SnowBall(const lisp::Lisp& reader) fluffy = false; reader.get("fluffy",fluffy); bbox.set_size(31.8, 31.8); - if (fluffy) sprite = sprite_manager->create("fluffy"); + if (fluffy) sprite = sprite_manager->create("images/creatures/fluffy/fluffy.sprite"); else sprite = sprite_manager->create("images/creatures/snowball/snowball.sprite"); set_direction = false; } diff --git a/src/object/flower.cpp b/src/object/flower.cpp index 9c2ac9149..04623a983 100644 --- a/src/object/flower.cpp +++ b/src/object/flower.cpp @@ -34,9 +34,9 @@ Flower::Flower(Type _type) bbox.set_size(32, 32); if(_type == FIREFLOWER) - sprite = sprite_manager->create("fireflower"); + sprite = sprite_manager->create("images/powerups/fireflower/fireflower.sprite"); else - sprite = sprite_manager->create("iceflower"); + sprite = sprite_manager->create("images/powerups/iceflower/iceflower.sprite"); set_group(COLGROUP_TOUCHABLE); } diff --git a/src/object/growup.cpp b/src/object/growup.cpp index 1e8406b58..cb98a2d50 100644 --- a/src/object/growup.cpp +++ b/src/object/growup.cpp @@ -32,7 +32,7 @@ GrowUp::GrowUp() { bbox.set_size(32, 32); - sprite = sprite_manager->create("egg"); + sprite = sprite_manager->create("images/powerups/egg/egg.sprite"); physic.enable_gravity(true); physic.set_velocity_x(100); set_group(COLGROUP_MOVING); diff --git a/src/object/oneup.cpp b/src/object/oneup.cpp index 464a3ebc0..25d6b5e25 100644 --- a/src/object/oneup.cpp +++ b/src/object/oneup.cpp @@ -31,7 +31,7 @@ OneUp::OneUp(const Vector& pos) { bbox.set_pos(pos); bbox.set_size(32, 32); - sprite = sprite_manager->create("1up"); + sprite = sprite_manager->create("images/powerups/1up/1up.sprite"); physic.set_velocity(100, 400); set_group(COLGROUP_TOUCHABLE); } diff --git a/src/object/powerup.cpp b/src/object/powerup.cpp index ad0f3df34..8b000d50a 100644 --- a/src/object/powerup.cpp +++ b/src/object/powerup.cpp @@ -31,7 +31,6 @@ PowerUp::PowerUp(const lisp::Lisp& lisp) { - std::string sprite_name; lisp.get("x", bbox.p1.x); lisp.get("y", bbox.p1.y); lisp.get("sprite", sprite_name); @@ -76,17 +75,17 @@ PowerUp::collision(GameObject& other, const CollisionHit& hit) script); return ABORT_MOVE; } - + // some defaults if no script has been set - if (sprite->get_name() == "egg") { + if (sprite_name == "images/powerups/egg/egg.sprite") { player->set_bonus(GROWUP_BONUS, true); sound_manager->play("sounds/grow.wav"); - } else if (sprite->get_name() == "fireflower") { + } else if (sprite_name == "images/powerups/fireflower/fireflower.sprite") { player->set_bonus(FIRE_BONUS, true); sound_manager->play("sounds/fire-flower.wav"); - } else if (sprite->get_name() == "star") { + } else if (sprite_name == "images/powerups/star/star.sprite") { player->make_invincible(); - } else if (sprite->get_name() == "1up") { + } else if (sprite_name == "images/powerups/1up/1up.sprite") { player->get_status()->incLives(); } return ABORT_MOVE; diff --git a/src/object/powerup.hpp b/src/object/powerup.hpp index 7e3446466..f7b656772 100644 --- a/src/object/powerup.hpp +++ b/src/object/powerup.hpp @@ -37,6 +37,7 @@ public: virtual HitResponse collision(GameObject& other, const CollisionHit& hit); private: + std::string sprite_name; Sprite* sprite; Physic physic; std::string script; diff --git a/src/object/star.cpp b/src/object/star.cpp index e0a89ebae..f02a7eae8 100644 --- a/src/object/star.cpp +++ b/src/object/star.cpp @@ -34,7 +34,7 @@ Star::Star(const Vector& pos) { bbox.set_pos(pos); bbox.set_size(32, 32); - sprite = sprite_manager->create("star"); + sprite = sprite_manager->create("images/powerups/star/star.sprite"); physic.set_velocity(SPEED, INITIALJUMP); set_group(COLGROUP_MOVING);