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.
+ (action
+ (name "pop")
+ (fps 2)
+ (hitbox 0 0 48 48)
+ (images "pop-0.png")
+ )
return;
state = STATE_EXPLODING;
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
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());