Split game objects into separate .sprite files
authorChristoph Sommer <mail@christoph-sommer.de>
Sun, 19 Mar 2006 21:31:03 +0000 (21:31 +0000)
committerChristoph Sommer <mail@christoph-sommer.de>
Sun, 19 Mar 2006 21:31:03 +0000 (21:31 +0000)
SVN-Revision: 3102

29 files changed:
data/images/objects/bonus_block/bonusblock.sprite [new file with mode: 0644]
data/images/objects/bonus_block/brick.sprite [new file with mode: 0644]
data/images/objects/bonus_block/icedbrick.sprite [new file with mode: 0644]
data/images/objects/bonus_block/infoblock.sprite [new file with mode: 0644]
data/images/objects/bonus_block/invisibleblock.sprite [new file with mode: 0644]
data/images/objects/coin/coin.sprite [new file with mode: 0644]
data/images/objects/eat-me/eat-me.sprite [new file with mode: 0644]
data/images/objects/flying_platform/platform.sprite [new file with mode: 0644]
data/images/objects/hatch/hatch.sprite [new file with mode: 0644]
data/images/objects/lightmap_light/lightmap_light.sprite [new file with mode: 0644]
data/images/objects/particles/rainsplash-vertical.sprite [new file with mode: 0644]
data/images/objects/particles/rainsplash.sprite [new file with mode: 0644]
data/images/objects/rock/rock.sprite [new file with mode: 0644]
data/images/objects/skull_tile/skull_tile.sprite [new file with mode: 0644]
data/images/objects/unstable_tile/unstable_tile.sprite [new file with mode: 0644]
data/images/sprites.strf
src/object/block.cpp
src/object/coin.cpp
src/object/gameobjs.cpp
src/object/infoblock.cpp
src/object/invisible_block.cpp
src/object/light.cpp
src/object/platform.cpp
src/object/rainsplash.cpp
src/object/rock.cpp
src/object/skull_tile.cpp
src/object/unstable_tile.cpp
src/trigger/door.cpp
src/trigger/hatch.cpp

diff --git a/data/images/objects/bonus_block/bonusblock.sprite b/data/images/objects/bonus_block/bonusblock.sprite
new file mode 100644 (file)
index 0000000..3f5924c
--- /dev/null
@@ -0,0 +1,19 @@
+(supertux-sprite
+      (action
+         (fps 15)
+         (name "normal")
+         (images "full-0.png"
+                 "full-1.png"
+                 "full-2.png"
+                 "full-3.png"
+                 "full-4.png"
+                 "full-2.png"
+                 "full-1.png"
+                 "full-0.png"
+                 "full-0.png"
+                 "full-0.png"
+                 ))
+      (action
+         (name "empty")
+         (images "empty.png"))
+)
diff --git a/data/images/objects/bonus_block/brick.sprite b/data/images/objects/bonus_block/brick.sprite
new file mode 100644 (file)
index 0000000..f60e4e9
--- /dev/null
@@ -0,0 +1,8 @@
+(supertux-sprite
+      (action 
+        (name "empty")
+        (images "empty.png"))
+      (action 
+        (name "normal")
+        (images "../../tiles/blocks/brick0.png"))
+)
diff --git a/data/images/objects/bonus_block/icedbrick.sprite b/data/images/objects/bonus_block/icedbrick.sprite
new file mode 100644 (file)
index 0000000..3e96973
--- /dev/null
@@ -0,0 +1,8 @@
+(supertux-sprite
+      (action 
+        (name "empty")
+        (images "empty.png"))
+      (action 
+        (name "normal")
+        (images "../../tiles/blocks/brick1.png"))
+)
diff --git a/data/images/objects/bonus_block/infoblock.sprite b/data/images/objects/bonus_block/infoblock.sprite
new file mode 100644 (file)
index 0000000..58ac97e
--- /dev/null
@@ -0,0 +1,6 @@
+(supertux-sprite
+    (action
+      (name "default")
+      (images "info_block.png")
+    )
+)
diff --git a/data/images/objects/bonus_block/invisibleblock.sprite b/data/images/objects/bonus_block/invisibleblock.sprite
new file mode 100644 (file)
index 0000000..4216e0c
--- /dev/null
@@ -0,0 +1,5 @@
+(supertux-sprite
+      (action
+        (name "empty")
+        (images "empty.png"))
+)
diff --git a/data/images/objects/coin/coin.sprite b/data/images/objects/coin/coin.sprite
new file mode 100644 (file)
index 0000000..979015e
--- /dev/null
@@ -0,0 +1,15 @@
+(supertux-sprite
+      (action 
+          (name "normal")
+          (images "coin-0.png"
+                  "coin-1.png"
+                  "coin-2.png"
+                  "coin-3.png"
+                  "coin-4.png"
+                  "coin-5.png"
+                  "coin-6.png"
+                  "coin-7.png"))
+      (action
+          (name "still")
+          (images "coin-0.png"))
+)
diff --git a/data/images/objects/eat-me/eat-me.sprite b/data/images/objects/eat-me/eat-me.sprite
new file mode 100644 (file)
index 0000000..bdb9da1
--- /dev/null
@@ -0,0 +1,6 @@
+(supertux-sprite
+    (action
+      (name "default")
+      (images "../../tiles/doodads/platter.png")
+    )
+)
diff --git a/data/images/objects/flying_platform/platform.sprite b/data/images/objects/flying_platform/platform.sprite
new file mode 100644 (file)
index 0000000..de027b1
--- /dev/null
@@ -0,0 +1,45 @@
+(supertux-sprite
+       (action
+         (name "flying")
+         (x-offset 0)
+         (y-offset 0)
+         (images "flying_platform-0.png"
+                 "flying_platform-1.png"
+                 "flying_platform-2.png"
+                 "flying_platform-3.png")
+       )
+       (action
+         (name "block1")
+         (x-offset 0)
+         (y-offset 0)
+         (images "../../tiles/blocks/block1.png")
+       )
+       (action
+         (name "block2")
+         (x-offset 0)
+         (y-offset 0)
+         (images "../../tiles/blocks/block2.png")
+       )
+       (action
+         (name "block3")
+         (x-offset 0)
+         (y-offset 0)
+         (images "../../tiles/blocks/block3.png")
+       )
+       (action
+         (name "block4")
+         (x-offset 0)
+         (y-offset 0)
+         (images "../../tiles/blocks/block4.png")
+       )
+       (action
+         (name "firefly")
+         (x-offset 0)
+         (y-offset 0)
+         (images "../../tiles/firefly/firefly1.png"
+                "../../tiles/firefly/firefly2.png"
+                 "../../tiles/firefly/firefly3.png"
+                 "../../tiles/firefly/firefly2.png")
+       )
+)
+
diff --git a/data/images/objects/hatch/hatch.sprite b/data/images/objects/hatch/hatch.sprite
new file mode 100644 (file)
index 0000000..e871d68
--- /dev/null
@@ -0,0 +1,17 @@
+(supertux-sprite
+       (action
+          (name "normal")
+          (x-offset 0)
+          (y-offset 0)
+          (images "hatch-0.png"))
+       (action
+          (name "open")
+          (x-offset 0)
+          (y-offset 0)
+          (images "hatch-0.png"
+                  "hatch-1.png"
+                  "hatch-2.png"
+                  "hatch-3.png"
+                  "hatch-4.png"
+                  "hatch-5.png"))
+)
diff --git a/data/images/objects/lightmap_light/lightmap_light.sprite b/data/images/objects/lightmap_light/lightmap_light.sprite
new file mode 100644 (file)
index 0000000..52d98aa
--- /dev/null
@@ -0,0 +1,6 @@
+(supertux-sprite
+    (action
+      (name "default")
+      (images "../../effects/light_red.png")
+    )
+)
diff --git a/data/images/objects/particles/rainsplash-vertical.sprite b/data/images/objects/particles/rainsplash-vertical.sprite
new file mode 100644 (file)
index 0000000..6e70d71
--- /dev/null
@@ -0,0 +1,9 @@
+(supertux-sprite
+    (action
+      (fps 20)
+      (images "rainsplash-vertical-1.png"
+              "rainsplash-vertical-2.png"
+              "rainsplash-vertical-3.png"
+              "rainsplash-vertical-4.png")
+    )
+)
diff --git a/data/images/objects/particles/rainsplash.sprite b/data/images/objects/particles/rainsplash.sprite
new file mode 100644 (file)
index 0000000..3d07fd5
--- /dev/null
@@ -0,0 +1,9 @@
+(supertux-sprite
+    (action
+      (fps 20)
+      (images "rainsplash-1.png"
+              "rainsplash-2.png"
+              "rainsplash-3.png"
+              "rainsplash-4.png")
+    )
+)
diff --git a/data/images/objects/rock/rock.sprite b/data/images/objects/rock/rock.sprite
new file mode 100644 (file)
index 0000000..66683d6
--- /dev/null
@@ -0,0 +1,5 @@
+(supertux-sprite
+      (action
+        (name "normal")
+        (images "../../tiles/blocks/block11.png"))
+)
diff --git a/data/images/objects/skull_tile/skull_tile.sprite b/data/images/objects/skull_tile/skull_tile.sprite
new file mode 100644 (file)
index 0000000..524536e
--- /dev/null
@@ -0,0 +1,4 @@
+(supertux-sprite
+    (action
+      (images "../skulls/skull.png"))
+) 
diff --git a/data/images/objects/unstable_tile/unstable_tile.sprite b/data/images/objects/unstable_tile/unstable_tile.sprite
new file mode 100644 (file)
index 0000000..2a0572d
--- /dev/null
@@ -0,0 +1,4 @@
+(supertux-sprite
+    (action
+      (images "unstable_tile.png"))
+)
index fc824cd..8aa48d8 100644 (file)
@@ -1,193 +1,8 @@
 ;; -*- mode: scheme; -*-
 (supertux-resources
 
-;; Tux is now in seperate .sprite files
+;; All sprites are in seperate .sprite files
+(ignore-me)
 
-;; Bad Guys are in separate .sprite files
-
-;; Game elements are in separate .sprite files
-
-;; Game Objects follow
-
-  ; Flying platform
-  (sprite (name "platform")
-       (action
-         (name "flying")
-         (x-offset 0)
-         (y-offset 0)
-         (images "objects/flying_platform/flying_platform-0.png"
-                 "objects/flying_platform/flying_platform-1.png"
-                 "objects/flying_platform/flying_platform-2.png"
-                 "objects/flying_platform/flying_platform-3.png")
-       )
-       (action
-         (name "block1")
-         (x-offset 0)
-         (y-offset 0)
-         (images "tiles/blocks/block1.png")
-       )
-       (action
-         (name "block2")
-         (x-offset 0)
-         (y-offset 0)
-         (images "tiles/blocks/block2.png")
-       )
-       (action
-         (name "block3")
-         (x-offset 0)
-         (y-offset 0)
-         (images "tiles/blocks/block3.png")
-       )
-       (action
-         (name "block4")
-         (x-offset 0)
-         (y-offset 0)
-         (images "tiles/blocks/block4.png")
-       )
-       (action
-         (name "firefly")
-         (x-offset 0)
-         (y-offset 0)
-         (images "tiles/firefly/firefly1.png"
-                "tiles/firefly/firefly2.png"
-                 "tiles/firefly/firefly3.png"
-                 "tiles/firefly/firefly2.png")
-       )
-  )
-
-  ; coin
-  (sprite (name "coin")
-      (action 
-          (name "normal")
-          (images "objects/coin/coin-0.png"
-                  "objects/coin/coin-1.png"
-                  "objects/coin/coin-2.png"
-                  "objects/coin/coin-3.png"
-                  "objects/coin/coin-4.png"
-                  "objects/coin/coin-5.png"
-                  "objects/coin/coin-6.png"
-                  "objects/coin/coin-7.png"))
-      (action
-          (name "still")
-          (images "objects/coin/coin-0.png"))
-  )
-
-  (sprite (name "bonusblock")
-      (action
-         (fps 15)
-         (name "normal")
-         (images "objects/bonus_block/full-0.png"
-                 "objects/bonus_block/full-1.png"
-                 "objects/bonus_block/full-2.png"
-                 "objects/bonus_block/full-3.png"
-                 "objects/bonus_block/full-4.png"
-                 "objects/bonus_block/full-2.png"
-                 "objects/bonus_block/full-1.png"
-                 "objects/bonus_block/full-0.png"
-                 "objects/bonus_block/full-0.png"
-                 "objects/bonus_block/full-0.png"
-                 ))
-      (action
-         (name "empty")
-         (images "objects/bonus_block/empty.png"))
-  )
-
-  (sprite (name "brick")
-      (action 
-        (name "empty")
-        (images "objects/bonus_block/empty.png"))
-      (action 
-        (name "normal")
-        (images "tiles/blocks/brick0.png"))
-  )
-
-  (sprite (name "icedbrick")
-      (action 
-        (name "empty")
-        (images "objects/bonus_block/empty.png"))
-      (action 
-        (name "normal")
-        (images "tiles/blocks/brick1.png"))
-  )
-
-  (sprite (name "infoblock")
-    (action
-      (name "default")
-      (images "objects/bonus_block/info_block.png")
-    )
-  )
-
-  (sprite (name "rock")
-      (action
-        (name "normal")
-        (images "tiles/blocks/block11.png"))
-  )
-
-  (sprite (name "invisibleblock")
-      (action
-        (name "empty")
-        (images "objects/bonus_block/empty.png"))
-  )                                        
-
-  (sprite (name "unstable_tile")
-    (action
-      (images "objects/unstable_tile/unstable_tile.png"))
-  )
-   (sprite (name "skull_tile")
-    (action
-      (images "objects/skulls/skull.png"))
-  ) 
-  (sprite (name "rainsplash")
-    (action
-      (fps 20)
-      (images "objects/particles/rainsplash-1.png"
-              "objects/particles/rainsplash-2.png"
-              "objects/particles/rainsplash-3.png"
-              "objects/particles/rainsplash-4.png")
-    )
-  )
-  (sprite (name "rainsplash-vertical")
-    (action
-      (fps 20)
-      (images "objects/particles/rainsplash-vertical-1.png"
-              "objects/particles/rainsplash-vertical-2.png"
-              "objects/particles/rainsplash-vertical-3.png"
-              "objects/particles/rainsplash-vertical-4.png")
-    )
-  )
-  
-  (sprite (name "hatch")
-       (action
-          (name "normal")
-          (x-offset 0)
-          (y-offset 0)
-          (images "objects/hatch/hatch-0.png"))
-       (action
-          (name "open")
-          (x-offset 0)
-          (y-offset 0)
-          (images "objects/hatch/hatch-0.png"
-                  "objects/hatch/hatch-1.png"
-                  "objects/hatch/hatch-2.png"
-                  "objects/hatch/hatch-3.png"
-                  "objects/hatch/hatch-4.png"
-                  "objects/hatch/hatch-5.png"))
-  )
-
-  (sprite
-    (name "lightmap_light")
-    (action
-      (name "default")
-      (images "effects/light_red.png")
-    )
-  )
-  
-  (sprite
-    (name "eat-me")
-    (action
-      (name "default")
-      (images "tiles/doodads/platter.png")
-    )
-  )
 )
 
index ac5bc57..63b02d9 100644 (file)
@@ -122,7 +122,7 @@ Block::start_bounce()
 //---------------------------------------------------------------------------
 
 BonusBlock::BonusBlock(const Vector& pos, int data)
-  : Block(sprite_manager->create("bonusblock")), object(0)
+  : Block(sprite_manager->create("images/objects/bonus_block/bonusblock.sprite")), object(0)
 {
   bbox.set_pos(pos);
   sprite->set_action("normal");
@@ -140,7 +140,7 @@ BonusBlock::BonusBlock(const Vector& pos, int data)
 }
 
 BonusBlock::BonusBlock(const lisp::Lisp& lisp)
-  : Block(sprite_manager->create("bonusblock"))
+  : Block(sprite_manager->create("images/objects/bonus_block/bonusblock.sprite"))
 {
   Vector pos;
 
@@ -268,7 +268,7 @@ IMPLEMENT_FACTORY(BonusBlock, "bonusblock");
 //---------------------------------------------------------------------------
 
 Brick::Brick(const Vector& pos, int data)
-  : Block(sprite_manager->create("brick")), breakable(false),
+  : Block(sprite_manager->create("images/objects/bonus_block/brick.sprite")), breakable(false),
     coin_counter(0)
 {
   bbox.set_pos(pos);
index d3eb1f5..8d969e1 100644 (file)
@@ -34,7 +34,7 @@ Coin::Coin(const Vector& pos)
 {
   bbox.set_pos(pos);
   bbox.set_size(32, 32);
-  sprite = sprite_manager->create("coin");
+  sprite = sprite_manager->create("images/objects/coin/coin.sprite");
   set_group(COLGROUP_TOUCHABLE);
 }
 
@@ -43,7 +43,7 @@ Coin::Coin(const lisp::Lisp& reader)
   reader.get("x", bbox.p1.x);
   reader.get("y", bbox.p1.y);
   bbox.set_size(32, 32);
-  sprite = sprite_manager->create("coin");
+  sprite = sprite_manager->create("images/objects/coin/coin.sprite");
   set_group(COLGROUP_TOUCHABLE);
 }
 
index 3ea669e..7e4a983 100644 (file)
@@ -41,7 +41,7 @@ BouncyCoin::BouncyCoin(const Vector& pos)
   : position(pos)
 {
   timer.start(.3);
-  sprite = sprite_manager->create("coin");
+  sprite = sprite_manager->create("images/objects/coin/coin.sprite");
   sprite->set_action("still");
 }
 
index 1008c07..f6703ec 100644 (file)
@@ -29,7 +29,7 @@
 #include "sector.hpp"
 
 InfoBlock::InfoBlock(const lisp::Lisp& lisp)
-  : Block(sprite_manager->create("infoblock"))
+  : Block(sprite_manager->create("images/objects/bonus_block/infoblock.sprite"))
 {
   Vector pos;
   lisp.get("x", pos.x);
index 4d28d26..38e2947 100644 (file)
@@ -29,7 +29,7 @@
 #include "object_factory.hpp"
 
 InvisibleBlock::InvisibleBlock(const Vector& pos)
-  : Block(sprite_manager->create("invisibleblock")), visible(false)
+  : Block(sprite_manager->create("images/objects/bonus_block/invisibleblock.sprite")), visible(false)
 {
   bbox.set_pos(pos);
   flags &= ~FLAG_SOLID;
index ebd8146..42dcc2c 100644 (file)
@@ -10,7 +10,7 @@
 
 Light::Light(const lisp::Lisp& )
 {
-  sprite = sprite_manager->create("lightmap_light");
+  sprite = sprite_manager->create("images/objects/lightmap_light/lightmap_light.sprite");
 }
 
 Light::~Light()
index c0a59a7..374a4ee 100644 (file)
@@ -38,7 +38,7 @@ Platform::Platform(const lisp::Lisp& reader)
   reader.get("y", bbox.p1.y);
   reader.get("type", type);
   reader.get("use_path", use_path);
-  sprite = sprite_manager->create("platform");
+  sprite = sprite_manager->create("images/objects/flying_platform/platform.sprite");
   sprite->set_action(type);
   bbox.set_size(sprite->get_width(), sprite->get_height());
 
index 2bd2cc9..d53e531 100644 (file)
@@ -21,8 +21,8 @@ RainSplash::RainSplash(Vector pos, bool vertical)
 {
   frame = 0;
   position = pos;
-  if (vertical) sprite = sprite_manager->create("rainsplash-vertical");
-  else sprite = sprite_manager->create("rainsplash");
+  if (vertical) sprite = sprite_manager->create("images/objects/particles/rainsplash-vertical.sprite");
+  else sprite = sprite_manager->create("images/objects/particles/rainsplash.sprite");
 }
   
 RainSplash::~RainSplash() {
index ea1ed64..5b022b5 100644 (file)
@@ -32,7 +32,7 @@ Rock::Rock(const lisp::Lisp& reader)
   reader.get("x", bbox.p1.x);
   reader.get("y", bbox.p1.y);
   bbox.set_size(31.8, 31.8);
-  sprite = sprite_manager->create("rock");
+  sprite = sprite_manager->create("images/objects/rock/rock.sprite");
   grabbed = false;
   flags |= FLAG_SOLID | FLAG_PORTABLE;
 }
index d49f407..d73a6d1 100644 (file)
@@ -37,7 +37,7 @@ SkullTile::SkullTile(const lisp::Lisp& lisp)
   lisp.get("x", bbox.p1.x);
   lisp.get("y", bbox.p1.y);
   bbox.set_size(32, 32);
-  sprite = sprite_manager->create("skull_tile");
+  sprite = sprite_manager->create("images/objects/skull_tile/skull_tile.sprite");
   flags |= FLAG_SOLID;
 
   set_group(COLGROUP_STATIC);
index 4db794b..543568a 100644 (file)
@@ -37,7 +37,7 @@ UnstableTile::UnstableTile(const lisp::Lisp& lisp)
   lisp.get("x", bbox.p1.x);
   lisp.get("y", bbox.p1.y);
   bbox.set_size(32, 32);
-  sprite = sprite_manager->create("unstable_tile");
+  sprite = sprite_manager->create("images/objects/unstable_tile/unstable_tile.sprite");
   flags |= FLAG_SOLID;
   set_group(COLGROUP_STATIC);
 }
index a7eaf55..5be83da 100644 (file)
@@ -47,7 +47,7 @@ Door::Door(int x, int y, std::string sector, std::string spawnpoint)
   target_sector = sector;
   target_spawnpoint = spawnpoint;
 
-  sprite = sprite_manager->create("door");
+  sprite = sprite_manager->create("images/objects/door/door.sprite");
 }
 
 Door::~Door()
index f2e11a3..440c2f1 100644 (file)
@@ -37,7 +37,7 @@ Hatch::Hatch(const lisp::Lisp& reader)
   reader.get("sector", target_sector);
   reader.get("spawnpoint", target_spawnpoint);
 
-  sprite = sprite_manager->create("hatch");
+  sprite = sprite_manager->create("images/objects/hatch/hatch.sprite");
 }
 
 Hatch::Hatch(int x, int y, std::string sector, std::string spawnpoint)
@@ -47,7 +47,7 @@ Hatch::Hatch(int x, int y, std::string sector, std::string spawnpoint)
   target_sector = sector;
   target_spawnpoint = spawnpoint;
 
-  sprite = sprite_manager->create("hatch");
+  sprite = sprite_manager->create("images/objects/hatch/hatch.sprite");
 }
 
 Hatch::~Hatch()