From: LMH Date: Sun, 9 Mar 2014 01:48:13 +0000 (-1000) Subject: More explosion variety. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=b727f3551303f71d627c95d9f14b9b0c3f1c4a2c;p=supertux.git More explosion variety. 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. --- diff --git a/data/images/objects/explosion/explosion-0.png b/data/images/objects/explosion/explosion-0.png index 53314a458..0be0aaca8 100644 Binary files a/data/images/objects/explosion/explosion-0.png and b/data/images/objects/explosion/explosion-0.png differ diff --git a/data/images/objects/explosion/explosion-1.png b/data/images/objects/explosion/explosion-1.png index e1a8415eb..18f55ee0e 100644 Binary files a/data/images/objects/explosion/explosion-1.png and b/data/images/objects/explosion/explosion-1.png differ diff --git a/data/images/objects/explosion/explosion.sprite b/data/images/objects/explosion/explosion.sprite index 74d9e58c8..72f1b4a1a 100644 --- a/data/images/objects/explosion/explosion.sprite +++ b/data/images/objects/explosion/explosion.sprite @@ -14,5 +14,11 @@ "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 index 000000000..70a5e50ac Binary files /dev/null and b/data/images/objects/explosion/pop-0.png differ diff --git a/src/object/explosion.cpp b/src/object/explosion.cpp index 543ef2b3f..5a22fa78b 100644 --- a/src/object/explosion.cpp +++ b/src/object/explosion.cpp @@ -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