weakblock: ice-themed sprite/behavior added, fire bullets absorbed, iceflower no...
authorLMH <lmh.0013@gmail.com>
Tue, 24 Jan 2012 20:32:05 +0000 (10:32 -1000)
committerLMH <lmh.0013@gmail.com>
Tue, 24 Jan 2012 20:32:05 +0000 (10:32 -1000)
45 files changed:
data/images/objects/strawbox/straw.png [deleted file]
data/images/objects/strawbox/straw_01.png [deleted file]
data/images/objects/strawbox/straw_02.png [deleted file]
data/images/objects/strawbox/straw_03.png [deleted file]
data/images/objects/strawbox/straw_04.png [deleted file]
data/images/objects/strawbox/straw_05.png [deleted file]
data/images/objects/strawbox/straw_06.png [deleted file]
data/images/objects/strawbox/straw_07.png [deleted file]
data/images/objects/strawbox/straw_08.png [deleted file]
data/images/objects/strawbox/straw_09.png [deleted file]
data/images/objects/strawbox/straw_10.png [deleted file]
data/images/objects/strawbox/straw_11.png [deleted file]
data/images/objects/strawbox/straw_12.png [deleted file]
data/images/objects/strawbox/strawbox.sprite [deleted file]
data/images/objects/weak_block/melt_01.png [new file with mode: 0644]
data/images/objects/weak_block/melt_02.png [new file with mode: 0644]
data/images/objects/weak_block/melt_03.png [new file with mode: 0644]
data/images/objects/weak_block/melt_04.png [new file with mode: 0644]
data/images/objects/weak_block/melt_05.png [new file with mode: 0644]
data/images/objects/weak_block/melt_06.png [new file with mode: 0644]
data/images/objects/weak_block/melt_07.png [new file with mode: 0644]
data/images/objects/weak_block/melt_08.png [new file with mode: 0644]
data/images/objects/weak_block/melt_09.png [new file with mode: 0644]
data/images/objects/weak_block/melt_10.png [new file with mode: 0644]
data/images/objects/weak_block/melt_11.png [new file with mode: 0644]
data/images/objects/weak_block/meltbox.png [new file with mode: 0644]
data/images/objects/weak_block/meltbox.sprite [new file with mode: 0644]
data/images/objects/weak_block/meltbox.xcf [new file with mode: 0644]
data/images/objects/weak_block/straw.png [new file with mode: 0644]
data/images/objects/weak_block/straw_01.png [new file with mode: 0644]
data/images/objects/weak_block/straw_02.png [new file with mode: 0644]
data/images/objects/weak_block/straw_03.png [new file with mode: 0644]
data/images/objects/weak_block/straw_04.png [new file with mode: 0644]
data/images/objects/weak_block/straw_05.png [new file with mode: 0644]
data/images/objects/weak_block/straw_06.png [new file with mode: 0644]
data/images/objects/weak_block/straw_07.png [new file with mode: 0644]
data/images/objects/weak_block/straw_08.png [new file with mode: 0644]
data/images/objects/weak_block/straw_09.png [new file with mode: 0644]
data/images/objects/weak_block/straw_10.png [new file with mode: 0644]
data/images/objects/weak_block/straw_11.png [new file with mode: 0644]
data/images/objects/weak_block/straw_12.png [new file with mode: 0644]
data/images/objects/weak_block/strawbox.sprite [new file with mode: 0644]
data/levels/test/weakblock.stl [new file with mode: 0755]
src/object/weak_block.cpp
src/object/weak_block.hpp

diff --git a/data/images/objects/strawbox/straw.png b/data/images/objects/strawbox/straw.png
deleted file mode 100644 (file)
index b8b5103..0000000
Binary files a/data/images/objects/strawbox/straw.png and /dev/null differ
diff --git a/data/images/objects/strawbox/straw_01.png b/data/images/objects/strawbox/straw_01.png
deleted file mode 100644 (file)
index 3068b38..0000000
Binary files a/data/images/objects/strawbox/straw_01.png and /dev/null differ
diff --git a/data/images/objects/strawbox/straw_02.png b/data/images/objects/strawbox/straw_02.png
deleted file mode 100644 (file)
index 8937527..0000000
Binary files a/data/images/objects/strawbox/straw_02.png and /dev/null differ
diff --git a/data/images/objects/strawbox/straw_03.png b/data/images/objects/strawbox/straw_03.png
deleted file mode 100644 (file)
index 7f2b5a4..0000000
Binary files a/data/images/objects/strawbox/straw_03.png and /dev/null differ
diff --git a/data/images/objects/strawbox/straw_04.png b/data/images/objects/strawbox/straw_04.png
deleted file mode 100644 (file)
index a81a541..0000000
Binary files a/data/images/objects/strawbox/straw_04.png and /dev/null differ
diff --git a/data/images/objects/strawbox/straw_05.png b/data/images/objects/strawbox/straw_05.png
deleted file mode 100644 (file)
index d84f3bb..0000000
Binary files a/data/images/objects/strawbox/straw_05.png and /dev/null differ
diff --git a/data/images/objects/strawbox/straw_06.png b/data/images/objects/strawbox/straw_06.png
deleted file mode 100644 (file)
index 81f385a..0000000
Binary files a/data/images/objects/strawbox/straw_06.png and /dev/null differ
diff --git a/data/images/objects/strawbox/straw_07.png b/data/images/objects/strawbox/straw_07.png
deleted file mode 100644 (file)
index 4ec91e1..0000000
Binary files a/data/images/objects/strawbox/straw_07.png and /dev/null differ
diff --git a/data/images/objects/strawbox/straw_08.png b/data/images/objects/strawbox/straw_08.png
deleted file mode 100644 (file)
index dec5edf..0000000
Binary files a/data/images/objects/strawbox/straw_08.png and /dev/null differ
diff --git a/data/images/objects/strawbox/straw_09.png b/data/images/objects/strawbox/straw_09.png
deleted file mode 100644 (file)
index bc6af5e..0000000
Binary files a/data/images/objects/strawbox/straw_09.png and /dev/null differ
diff --git a/data/images/objects/strawbox/straw_10.png b/data/images/objects/strawbox/straw_10.png
deleted file mode 100644 (file)
index ec38f05..0000000
Binary files a/data/images/objects/strawbox/straw_10.png and /dev/null differ
diff --git a/data/images/objects/strawbox/straw_11.png b/data/images/objects/strawbox/straw_11.png
deleted file mode 100644 (file)
index d5b8e48..0000000
Binary files a/data/images/objects/strawbox/straw_11.png and /dev/null differ
diff --git a/data/images/objects/strawbox/straw_12.png b/data/images/objects/strawbox/straw_12.png
deleted file mode 100644 (file)
index b0aa3f2..0000000
Binary files a/data/images/objects/strawbox/straw_12.png and /dev/null differ
diff --git a/data/images/objects/strawbox/strawbox.sprite b/data/images/objects/strawbox/strawbox.sprite
deleted file mode 100644 (file)
index 0cb15cd..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-(supertux-sprite
-  (action
-    (name "normal")
-    (images 
-      "straw.png"
-    )
-  )
-  (action
-    (name "burning")
-    (images 
-      "straw_01.png"
-      "straw_02.png"
-      "straw_03.png"
-      "straw_04.png"
-      "straw_05.png"
-      "straw_06.png"
-    )
-  )
-  (action
-    (name "disintegrating")
-    (images 
-      "straw_07.png"
-      "straw_08.png"
-      "straw_09.png"
-      "straw_10.png"
-      "straw_11.png"
-    )
-  )
-)
diff --git a/data/images/objects/weak_block/melt_01.png b/data/images/objects/weak_block/melt_01.png
new file mode 100644 (file)
index 0000000..abcb86a
Binary files /dev/null and b/data/images/objects/weak_block/melt_01.png differ
diff --git a/data/images/objects/weak_block/melt_02.png b/data/images/objects/weak_block/melt_02.png
new file mode 100644 (file)
index 0000000..bec8ba5
Binary files /dev/null and b/data/images/objects/weak_block/melt_02.png differ
diff --git a/data/images/objects/weak_block/melt_03.png b/data/images/objects/weak_block/melt_03.png
new file mode 100644 (file)
index 0000000..77034bb
Binary files /dev/null and b/data/images/objects/weak_block/melt_03.png differ
diff --git a/data/images/objects/weak_block/melt_04.png b/data/images/objects/weak_block/melt_04.png
new file mode 100644 (file)
index 0000000..c890cb1
Binary files /dev/null and b/data/images/objects/weak_block/melt_04.png differ
diff --git a/data/images/objects/weak_block/melt_05.png b/data/images/objects/weak_block/melt_05.png
new file mode 100644 (file)
index 0000000..b5a9562
Binary files /dev/null and b/data/images/objects/weak_block/melt_05.png differ
diff --git a/data/images/objects/weak_block/melt_06.png b/data/images/objects/weak_block/melt_06.png
new file mode 100644 (file)
index 0000000..2af04b1
Binary files /dev/null and b/data/images/objects/weak_block/melt_06.png differ
diff --git a/data/images/objects/weak_block/melt_07.png b/data/images/objects/weak_block/melt_07.png
new file mode 100644 (file)
index 0000000..26eae96
Binary files /dev/null and b/data/images/objects/weak_block/melt_07.png differ
diff --git a/data/images/objects/weak_block/melt_08.png b/data/images/objects/weak_block/melt_08.png
new file mode 100644 (file)
index 0000000..b65f294
Binary files /dev/null and b/data/images/objects/weak_block/melt_08.png differ
diff --git a/data/images/objects/weak_block/melt_09.png b/data/images/objects/weak_block/melt_09.png
new file mode 100644 (file)
index 0000000..233e8e2
Binary files /dev/null and b/data/images/objects/weak_block/melt_09.png differ
diff --git a/data/images/objects/weak_block/melt_10.png b/data/images/objects/weak_block/melt_10.png
new file mode 100644 (file)
index 0000000..863b404
Binary files /dev/null and b/data/images/objects/weak_block/melt_10.png differ
diff --git a/data/images/objects/weak_block/melt_11.png b/data/images/objects/weak_block/melt_11.png
new file mode 100644 (file)
index 0000000..c0f5d8f
Binary files /dev/null and b/data/images/objects/weak_block/melt_11.png differ
diff --git a/data/images/objects/weak_block/meltbox.png b/data/images/objects/weak_block/meltbox.png
new file mode 100644 (file)
index 0000000..a074a23
Binary files /dev/null and b/data/images/objects/weak_block/meltbox.png differ
diff --git a/data/images/objects/weak_block/meltbox.sprite b/data/images/objects/weak_block/meltbox.sprite
new file mode 100644 (file)
index 0000000..a62c2ae
--- /dev/null
@@ -0,0 +1,29 @@
+(supertux-sprite
+  (action
+    (name "normal")
+    (images 
+      "meltbox.png"
+    )
+  )
+  (action
+    (name "burning")
+    (images 
+      "melt_01.png"
+                       "melt_02.png"
+                       "melt_03.png"
+                       "melt_04.png"
+                       "melt_05.png"
+    )
+  )
+  (action
+    (name "disintegrating")
+    (images 
+      "melt_06.png"
+      "melt_07.png"
+      "melt_08.png"
+      "melt_09.png"
+      "melt_10.png"
+      "melt_11.png"
+    )
+  )
+)
diff --git a/data/images/objects/weak_block/meltbox.xcf b/data/images/objects/weak_block/meltbox.xcf
new file mode 100644 (file)
index 0000000..7743902
Binary files /dev/null and b/data/images/objects/weak_block/meltbox.xcf differ
diff --git a/data/images/objects/weak_block/straw.png b/data/images/objects/weak_block/straw.png
new file mode 100644 (file)
index 0000000..b8b5103
Binary files /dev/null and b/data/images/objects/weak_block/straw.png differ
diff --git a/data/images/objects/weak_block/straw_01.png b/data/images/objects/weak_block/straw_01.png
new file mode 100644 (file)
index 0000000..3068b38
Binary files /dev/null and b/data/images/objects/weak_block/straw_01.png differ
diff --git a/data/images/objects/weak_block/straw_02.png b/data/images/objects/weak_block/straw_02.png
new file mode 100644 (file)
index 0000000..8937527
Binary files /dev/null and b/data/images/objects/weak_block/straw_02.png differ
diff --git a/data/images/objects/weak_block/straw_03.png b/data/images/objects/weak_block/straw_03.png
new file mode 100644 (file)
index 0000000..7f2b5a4
Binary files /dev/null and b/data/images/objects/weak_block/straw_03.png differ
diff --git a/data/images/objects/weak_block/straw_04.png b/data/images/objects/weak_block/straw_04.png
new file mode 100644 (file)
index 0000000..a81a541
Binary files /dev/null and b/data/images/objects/weak_block/straw_04.png differ
diff --git a/data/images/objects/weak_block/straw_05.png b/data/images/objects/weak_block/straw_05.png
new file mode 100644 (file)
index 0000000..d84f3bb
Binary files /dev/null and b/data/images/objects/weak_block/straw_05.png differ
diff --git a/data/images/objects/weak_block/straw_06.png b/data/images/objects/weak_block/straw_06.png
new file mode 100644 (file)
index 0000000..81f385a
Binary files /dev/null and b/data/images/objects/weak_block/straw_06.png differ
diff --git a/data/images/objects/weak_block/straw_07.png b/data/images/objects/weak_block/straw_07.png
new file mode 100644 (file)
index 0000000..4ec91e1
Binary files /dev/null and b/data/images/objects/weak_block/straw_07.png differ
diff --git a/data/images/objects/weak_block/straw_08.png b/data/images/objects/weak_block/straw_08.png
new file mode 100644 (file)
index 0000000..dec5edf
Binary files /dev/null and b/data/images/objects/weak_block/straw_08.png differ
diff --git a/data/images/objects/weak_block/straw_09.png b/data/images/objects/weak_block/straw_09.png
new file mode 100644 (file)
index 0000000..bc6af5e
Binary files /dev/null and b/data/images/objects/weak_block/straw_09.png differ
diff --git a/data/images/objects/weak_block/straw_10.png b/data/images/objects/weak_block/straw_10.png
new file mode 100644 (file)
index 0000000..ec38f05
Binary files /dev/null and b/data/images/objects/weak_block/straw_10.png differ
diff --git a/data/images/objects/weak_block/straw_11.png b/data/images/objects/weak_block/straw_11.png
new file mode 100644 (file)
index 0000000..d5b8e48
Binary files /dev/null and b/data/images/objects/weak_block/straw_11.png differ
diff --git a/data/images/objects/weak_block/straw_12.png b/data/images/objects/weak_block/straw_12.png
new file mode 100644 (file)
index 0000000..b0aa3f2
Binary files /dev/null and b/data/images/objects/weak_block/straw_12.png differ
diff --git a/data/images/objects/weak_block/strawbox.sprite b/data/images/objects/weak_block/strawbox.sprite
new file mode 100644 (file)
index 0000000..0cb15cd
--- /dev/null
@@ -0,0 +1,29 @@
+(supertux-sprite
+  (action
+    (name "normal")
+    (images 
+      "straw.png"
+    )
+  )
+  (action
+    (name "burning")
+    (images 
+      "straw_01.png"
+      "straw_02.png"
+      "straw_03.png"
+      "straw_04.png"
+      "straw_05.png"
+      "straw_06.png"
+    )
+  )
+  (action
+    (name "disintegrating")
+    (images 
+      "straw_07.png"
+      "straw_08.png"
+      "straw_09.png"
+      "straw_10.png"
+      "straw_11.png"
+    )
+  )
+)
diff --git a/data/levels/test/weakblock.stl b/data/levels/test/weakblock.stl
new file mode 100755 (executable)
index 0000000..7c52d27
--- /dev/null
@@ -0,0 +1,141 @@
+(supertux-level                                                                                                                                                                                                                                                                                                                                                        
+       (version 2)                                                                                                                                                                                                                                                                                                                                             
+       (name (_ "Weakblock Test"))                                                                                                                                                                                                                                                                                                                                             
+       (author "LMH")                                                                                                                                                                                                                                                                                                                                          
+       (license        "GPL 2 / CC-by-sa 3.0"  )                                                                                                                                                                                                                                                                                                                               
+       (sector (name   "main"  )                                                                                                                                                                                                                                                                                                                       
+               (ambient-light  1       1       1       )                                                                                                                                                                                                                                                                                                       
+               (camera (mode   "normal"        ))                                                                                                                                                                                                                                                                                                              
+                                                                                                                                                                                                                                                                                                                                                       
+               (spawnpoint     (name   "main"  )                                                                                                                                                                                                                                                                                                               
+                       (x      80      )(y     704     ))                                                                                                                                                                                                                                                                                              
+                                                                                                                                                                                                                                                                                                                                                       
+               (tilemap        (name   "Interactive"   )                                                                                                                                                                                                                                                                                                               
+                       (z-pos  0       )(solid #t      )                                                                                                                                                                                                                                                                                               
+                       (width  42      )(height        30      )                                                                                                                                                                                                                                                                                               
+                       (tiles  ;       160     192     224     256     288     320     352     384     416     448     480     512     544     576     608     640     672     704     736     768     800     832     864     896     928     960     992     1024    1056    1088    1120    1152    1184    1216    1248    1280    1312            
+0      0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0               
+0      0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       ;       32
+0      0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       ;       64
+0      0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       ;       96
+0      0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       ;       128
+0      0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       ;       160
+0      0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       ;       192
+0      0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       ;       224
+0      0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       ;       256
+0      0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       ;       288
+0      0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       ;       320
+0      0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       ;       352
+0      0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       ;       384
+0      0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       ;       416
+0      0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       ;       448
+0      0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       ;       480
+0      0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       ;       512
+0      0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       ;       544
+0      0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       ;       576
+0      0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       ;       608
+0      0       0       0       140     0       140     0       0       102     0       102     0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       ;       640
+0      0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       ;       672
+0      0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       ;       704
+8      8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       8       ;       736
+14     14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      14      ;       768
+11     11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      ;       800
+11     11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      ;       832
+11     11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      ;       864
+11     11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      ;       896
+11     11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      11      ;       928
+               ))                                                                                                                                                                                                                                                                                                                                      
+    (weak_block
+      (linked  #f      )
+      (x       480     )(y     736     ))
+    (weak_block
+      (linked  #f      )
+      (x       512     )(y     736     ))
+    (weak_block
+      (linked  #f      )
+      (x       544     )(y     736     ))
+    (weak_block
+      (linked  #f      )
+      (x       576     )(y     736     ))                                                                                                                                                                                                                                                                                                                                      
+    (weak_block
+      (linked  #f      )
+      (x       608     )(y     736     ))                                                                                                                                                                                                                                                                                                                                      
+    (weak_block
+      (linked  #f      )
+      (x       640     )(y     736     ))                                                                                                                                                                                                                                                                                                                                      
+    (weak_block
+      (linked  #f      )
+      (x       672     )(y     736     ))
+    (weak_block
+      (x       480     )(y     672     ))
+    (weak_block
+      (x       512     )(y     672     ))
+    (weak_block
+      (x       544     )(y     672     ))
+    (weak_block
+      (x       576     )(y     672     ))
+    (weak_block
+      (x       608     )(y     672     ))
+    (weak_block
+      (x       640     )(y     672     ))
+    (weak_block
+      (x       672     )(y     672     ))
+    
+    (weak_block
+      (linked  #f      )
+      (x       736     )(y     704     ))
+    (weak_block
+      (linked  #f      )
+      (x       768     )(y     704     ))
+    (weak_block
+      (linked  #f      )
+      (x       800     )(y     704     ))
+    (weak_block
+      (linked  #f      )
+      (x       832     )(y     704     ))                                                                                                                                                                                                                                                                                                                                      
+    (weak_block
+      (linked  #f      )
+      (x       864     )(y     704     ))                                                                                                                                                                                                                                                                                                                                      
+    (weak_block
+      (linked  #f      )
+      (x       896     )(y     704     ))                                                                                                                                                                                                                                                                                                                                      
+    (weak_block
+      (linked  #f      )
+      (x       928     )(y     704     ))
+    (weak_block
+      (x       736     )(y     672     ))
+    (weak_block
+      (x       768     )(y     672     ))
+    (weak_block
+      (x       800     )(y     672     ))
+    (weak_block
+      (x       832     )(y     672     ))
+    (weak_block
+      (x       864     )(y     672     ))
+    (weak_block
+      (x       896     )(y     672     ))
+    (weak_block
+      (x       928     )(y     672     ))
+      
+    (weak_block
+      (linked  #t      )(sprite  "images/objects/weak_block/meltbox.sprite"  )
+      (x       992     )(y     704     ))
+    (weak_block
+      (linked  #t      )(sprite  "images/objects/weak_block/meltbox.sprite"  )
+      (x       1024    )(y     704     ))
+    (weak_block
+      (linked  #t      )(sprite  "images/objects/weak_block/meltbox.sprite"  )
+      (x       1056    )(y     704     ))
+    (weak_block
+      (linked  #t      )(sprite  "images/objects/weak_block/meltbox.sprite"  )
+      (x       1088    )(y     704     ))                                                                                                                                                                                                                                                                                                                                      
+    (weak_block
+      (linked  #t      )(sprite  "images/objects/weak_block/meltbox.sprite"  )
+      (x       1120    )(y     704     ))                                                                                                                                                                                                                                                                                                                                      
+    (weak_block
+      (linked  #t      )(sprite  "images/objects/weak_block/meltbox.sprite"  )
+      (x       1152    )(y     704     ))                                                                                                                                                                                                                                                                                                                                      
+    (weak_block
+      (linked  #t      )(sprite  "images/objects/weak_block/meltbox.sprite"  )
+      (x       1184    )(y     704     ))
+))                                                                                                                                                                                                                                                                                                                                                     
index b9d10c5..78644d6 100644 (file)
 #include "object/explosion.hpp"
 #include "supertux/object_factory.hpp"
 #include "supertux/sector.hpp"
+#include "sprite/sprite.hpp"
+#include "sprite/sprite_manager.hpp"
+#include "util/reader.hpp"
 
 #include <math.h>
 
 WeakBlock::WeakBlock(const Reader& lisp)
-  : MovingSprite(lisp, "images/objects/strawbox/strawbox.sprite", LAYER_TILES, COLGROUP_STATIC), state(STATE_NORMAL)
+: MovingSprite(lisp, "images/objects/weak_block/strawbox.sprite", LAYER_TILES, COLGROUP_STATIC), state(STATE_NORMAL),
+linked(true)
 {
   sprite->set_action("normal");
+  //Check if this weakblock destroys adjacent weakblocks
+  if(lisp.get("linked", linked)){
+    if(! linked){
+      sprite_name = "images/objects/weak_block/meltbox.sprite";
+      sprite = sprite_manager->create(sprite_name);
+      sprite->set_action("normal");
+    }
+  }
 }
 
 HitResponse
-WeakBlock::collision(GameObject& other, const CollisionHit& )
+WeakBlock::collision_bullet(Bullet& bullet, const CollisionHit& hit)
 {
   switch (state) {
-
+                       
     case STATE_NORMAL:
-      if (dynamic_cast<Bullet*>(&other)) {
+      //Ensure only fire destroys weakblock
+      if(bullet.get_type() == FIRE_BONUS) {
         startBurning();
+        bullet.remove_me();
       }
-      if (dynamic_cast<Explosion*> (&other)) {
-        startBurning();
+      //Other bullets ricochet
+      else {
+        bullet.ricochet(*this, hit);
       }
-      break;
-
+    break;
+                       
     case STATE_BURNING:
     case STATE_DISINTEGRATING:
       break;
-
+                       
     default:
       log_debug << "unhandled state" << std::endl;
       break;
-  }
+       }
+       
+       return FORCE_MOVE;
+}
 
+HitResponse
+WeakBlock::collision(GameObject& other, const CollisionHit& hit)
+{
+  switch (state) {
+                               
+      case STATE_NORMAL:
+        if (Bullet* bullet = dynamic_cast<Bullet*> (&other)) {
+          return collision_bullet(*bullet, hit);
+        }
+        //Explosions destroy weakblocks as well
+        if (dynamic_cast<Explosion*> (&other)) {
+          startBurning();
+        }
+        break;
+                               
+      case STATE_BURNING:
+      case STATE_DISINTEGRATING:
+        break;
+                               
+      default:
+        log_debug << "unhandled state" << std::endl;
+        break;
+  }
+       
   return FORCE_MOVE;
 }
 
@@ -60,26 +102,26 @@ void
 WeakBlock::update(float )
 {
   switch (state) {
-
-    case STATE_NORMAL:
-      break;
-
-    case STATE_BURNING:
-      if (sprite->animation_done()) {
-        state = STATE_DISINTEGRATING;
-        sprite->set_action("disintegrating", 1);
-        spreadHit();
-        set_group(COLGROUP_DISABLED);
-      }
-      break;
-
-    case STATE_DISINTEGRATING:
-      if (sprite->animation_done()) {
-        remove_me();
-        return;
-      }
-      break;
-
+                               
+      case STATE_NORMAL:
+        break;
+                               
+      case STATE_BURNING:
+        if (sprite->animation_done()) {
+          state = STATE_DISINTEGRATING;
+          sprite->set_action("disintegrating", 1);
+          spreadHit();
+          set_group(COLGROUP_DISABLED);
+        }
+        break;
+                               
+      case STATE_DISINTEGRATING:
+        if (sprite->animation_done()) {
+          remove_me();
+          return;
+        }
+        break;
+                               
   }
 }
 
@@ -94,19 +136,22 @@ WeakBlock::startBurning()
 void
 WeakBlock::spreadHit()
 {
-  Sector* sector = Sector::current();
-  if (!sector) {
-    log_debug << "no current sector" << std::endl;
-    return;
-  }
-  for(Sector::GameObjects::iterator i = sector->gameobjects.begin(); i != sector->gameobjects.end(); ++i) {
-    WeakBlock* wb = dynamic_cast<WeakBlock*>(*i);
-    if (!wb) continue;
-    if (wb == this) continue;
-    if (wb->state != STATE_NORMAL) continue;
-    float dx = fabsf(wb->get_pos().x - this->get_pos().x);
-    float dy = fabsf(wb->get_pos().y - this->get_pos().y);
-    if ((dx <= 32.5) && (dy <= 32.5)) wb->startBurning();
+  //Destroy adjacent weakblocks if applicable
+  if(linked) {
+    Sector* sector = Sector::current();
+    if (!sector) {
+      log_debug << "no current sector" << std::endl;
+      return;
+    }
+    for(Sector::GameObjects::iterator i = sector->gameobjects.begin(); i != sector->gameobjects.end(); ++i) {
+      WeakBlock* wb = dynamic_cast<WeakBlock*>(*i);
+      if (!wb) continue;
+      if (wb == this) continue;
+      if (wb->state != STATE_NORMAL) continue;
+      float dx = fabsf(wb->get_pos().x - this->get_pos().x);
+      float dy = fabsf(wb->get_pos().y - this->get_pos().y);
+      if ((dx <= 32.5) && (dy <= 32.5)) wb->startBurning();
+    }
   }
 }
 
index dedd0a9..133b713 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "object/moving_sprite.hpp"
 #include "supertux/physic.hpp"
+#include "object/bullet.hpp"
+
 
 /**
  * A block that can be destroyed by Bullet hits
@@ -31,7 +33,7 @@ public:
 
   HitResponse collision(GameObject& other, const CollisionHit& hit);
   void update(float elapsed_time);
-
+       
 protected:
   /**
    * called by self when hit by a bullet
@@ -50,6 +52,10 @@ private:
     STATE_DISINTEGRATING /**< crumbling to dust, no longer solid */
   };
   State state;
+       
+  bool linked;
+  virtual HitResponse collision_bullet(Bullet& bullet, const CollisionHit& hit);
+
 };
 
 #endif