Moved powerups to separate .sprite files
authorChristoph Sommer <mail@christoph-sommer.de>
Wed, 8 Mar 2006 11:46:45 +0000 (11:46 +0000)
committerChristoph Sommer <mail@christoph-sommer.de>
Wed, 8 Mar 2006 11:46:45 +0000 (11:46 +0000)
SVN-Revision: 3079

36 files changed:
data/Jamfile
data/images/powerups/1up/1up.sprite [new file with mode: 0644]
data/images/powerups/egg/egg.sprite [new file with mode: 0644]
data/images/powerups/fire_flower/fire_flower-0.png [deleted file]
data/images/powerups/fire_flower/fire_flower-1.png [deleted file]
data/images/powerups/fire_flower/fire_flower-2.png [deleted file]
data/images/powerups/fire_flower/fire_flower-3.png [deleted file]
data/images/powerups/fireflower/fire_flower-0.png [new file with mode: 0644]
data/images/powerups/fireflower/fire_flower-1.png [new file with mode: 0644]
data/images/powerups/fireflower/fire_flower-2.png [new file with mode: 0644]
data/images/powerups/fireflower/fire_flower-3.png [new file with mode: 0644]
data/images/powerups/fireflower/fireflower.sprite [new file with mode: 0644]
data/images/powerups/ice_flower/ice_flower-0.png [deleted file]
data/images/powerups/ice_flower/ice_flower-1.png [deleted file]
data/images/powerups/ice_flower/ice_flower-2.png [deleted file]
data/images/powerups/iceflower/ice_flower-0.png [new file with mode: 0644]
data/images/powerups/iceflower/ice_flower-1.png [new file with mode: 0644]
data/images/powerups/iceflower/ice_flower-2.png [new file with mode: 0644]
data/images/powerups/iceflower/iceflower.sprite [new file with mode: 0644]
data/images/powerups/star/star.sprite [new file with mode: 0644]
data/images/sprites.strf
data/levels/test/bonusblock.stl
data/levels/test/enemy3.stl
data/levels/test/platform.stl
data/levels/test/raintest.stl
data/levels/world1/cs.po
data/levels/world1/level1.stl
data/levels/world2/level1.stl
src/badguy/angrystone.cpp
src/badguy/snowball.cpp
src/object/flower.cpp
src/object/growup.cpp
src/object/oneup.cpp
src/object/powerup.cpp
src/object/powerup.hpp
src/object/star.cpp

index 07bbf5c..32fab8c 100644 (file)
@@ -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 (file)
index 0000000..8b540f6
--- /dev/null
@@ -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 (file)
index 0000000..de0d0f8
--- /dev/null
@@ -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 (file)
index b6d6f67..0000000
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 (file)
index 86424ed..0000000
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 (file)
index f88bc71..0000000
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 (file)
index 205b87f..0000000
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 (file)
index 0000000..b6d6f67
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 (file)
index 0000000..86424ed
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 (file)
index 0000000..f88bc71
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 (file)
index 0000000..205b87f
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 (file)
index 0000000..65980bc
--- /dev/null
@@ -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 (file)
index d5735fc..0000000
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 (file)
index 6d48ad5..0000000
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 (file)
index 5710534..0000000
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 (file)
index 0000000..d5735fc
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 (file)
index 0000000..6d48ad5
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 (file)
index 0000000..5710534
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 (file)
index 0000000..4216ccd
--- /dev/null
@@ -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 (file)
index 0000000..c0da3fa
--- /dev/null
@@ -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")))
index 145c17e..fc824cd 100644 (file)
@@ -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
 
index d2c8dca..73189d0 100644 (file)
          (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
index d1f4fe8..54366d1 100644 (file)
     (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")
index 9bee198..62594af 100644 (file)
    (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))
    )
index a7b5d4a..81cc5ec 100644 (file)
      (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);
index ce7db59..5423817 100644 (file)
@@ -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"
index 64a21aa..3b064bc 100644 (file)
 #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.
index d233e53..ff87705 100644 (file)
                        (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))
index ff7c862..a3eb781 100644 (file)
@@ -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;
 }
 
index f3f0a5e..8da2e70 100644 (file)
@@ -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;
 }
index 9c2ac91..04623a9 100644 (file)
@@ -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);
 }
index 1e8406b..cb98a2d 100644 (file)
@@ -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);
index 464a3eb..25d6b5e 100644 (file)
@@ -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);
 }
index ad0f3df..8b000d5 100644 (file)
@@ -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;
index 7e34464..f7b6567 100644 (file)
@@ -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;
index e0a89eb..f02a7ea 100644 (file)
@@ -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);