← Cuzco Explosions GFX
Explosions
Download explosions
👁️
val animation = SpriteAnimation(
resourcesVfs["gfx/exp2.jpg"].readBitmapSlice().splitInRows(64, 64),
60.milliseconds
)
val random = Random(0L)
interval(0.02.seconds) {
sprite(animation).xy(random[0, 250], random[0, 250]).also { it.blendMode = BlendMode.SCREEN }
.also { sprite -> sprite.onAnimationCompleted { sprite.removeFromParent() } }
.playAnimation()
}
+ Sound
Download sound
val sound = resourcesVfs["sfx/explodify.mp3"].readSound()
val animation = SpriteAnimation(
resourcesVfs["gfx/exp2.jpg"].readBitmapSlice().splitInRows(64, 64),
60.milliseconds
)
val random = Random(0L)
interval(.25.seconds) {
sound.playNoCancel(1.playbackTimes).also { it.volume = .3 }
sprite(animation).xy(random[0, 250], random[0, 250]).also { it.blendMode = BlendMode.SCREEN }
.also { sprite -> sprite.onAnimationCompleted { sprite.removeFromParent() } }
.playAnimation()
}