More explosion variety.
authorLMH <lmh.0013@gmail.com>
Sun, 9 Mar 2014 01:48:13 +0000 (15:48 -1000)
committerLMH <lmh.0013@gmail.com>
Sun, 9 Mar 2014 01:48:13 +0000 (15:48 -1000)
Explosions are randomly rotated to give them the appearance of being more unique.  Gave explosions that do not hurt Tux a less-threatining graphic, and changed the hurting explosion graphic to one without vertical shading (adapted from the Cheeseman spin-off).  All these graphics should be considered placeholders until something better, and more animated, becomes available.

data/images/objects/explosion/explosion-0.png
data/images/objects/explosion/explosion-1.png
data/images/objects/explosion/explosion.sprite
data/images/objects/explosion/pop-0.png [new file with mode: 0644]
src/object/explosion.cpp

index 53314a4..0be0aac 100644 (file)
Binary files a/data/images/objects/explosion/explosion-0.png and b/data/images/objects/explosion/explosion-0.png differ
index e1a8415..18f55ee 100644 (file)
Binary files a/data/images/objects/explosion/explosion-1.png and b/data/images/objects/explosion/explosion-1.png differ
index 74d9e58..72f1b4a 100644 (file)
       "explosion-1.png"
     )
   )
+  (action
+    (name "pop")
+    (fps 2)
+    (hitbox 0 0 48 48)
+    (images "pop-0.png")
+  )
 )
 
diff --git a/data/images/objects/explosion/pop-0.png b/data/images/objects/explosion/pop-0.png
new file mode 100644 (file)
index 0000000..70a5e50
Binary files /dev/null and b/data/images/objects/explosion/pop-0.png differ
index 543ef2b..5a22fa7 100644 (file)
@@ -65,12 +65,10 @@ Explosion::explode()
     return;
   state = STATE_EXPLODING;
 
-  set_action("default", 1); //TODO: the less-threatening short_fuse explosion should look less-threatening
+  set_action(hurt ? "default" : "pop", 1);
   sprite->set_animation_loops(1); //TODO: this is necessary because set_action will not set "loops" when "action" is the default action
-  if (hurt)
-    sound_manager->play("sounds/explosion.wav", get_pos());
-  else
-    sound_manager->play("sounds/firecracker.ogg", get_pos());
+  sprite->set_angle(graphicsRandom.randf(0, 360)); // a random rotation on the sprite to make explosions appear more random
+  sound_manager->play(hurt ? "sounds/explosion.wav" : "sounds/firecracker.ogg", get_pos());
     
 
 #if 0