big smoke texture

This commit is contained in:
minjaesong
2021-08-28 23:12:05 +09:00
parent 02f5abe763
commit c247f99e0e
6 changed files with 13 additions and 7 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 707 KiB

View File

@@ -69,10 +69,9 @@ class ParticleVanishingText(val text: String, x: Double, y: Double, noCollision:
* @param x x-coord of the particle's initial spawn position, bottom-centre * @param x x-coord of the particle's initial spawn position, bottom-centre
* @param y y-coord of the particle's initial spawn position, bottom-centre * @param y y-coord of the particle's initial spawn position, bottom-centre
*/ */
open class ParticleVanishingSprite(val sprite: TextureRegionPack, val delay: Float, x: Double, y: Double, val start: Int = 0, noCollision: Boolean = true) : ParticleBase(Actor.RenderOrder.OVERLAY, false, noCollision, 2f) { open class ParticleVanishingSprite(val sprite: TextureRegionPack, val delay: Float, val loop: Boolean, x: Double, y: Double, noCollision: Boolean = true, startFrame: Int = 0, val row: Int = 0) : ParticleBase(Actor.RenderOrder.OVERLAY, false, noCollision, 2f) {
private var row = 0 private var frame = startFrame % sprite.horizontalCount
private var frame = start % sprite.horizontalCount
private var frameAdvanceCounter = 0f private var frameAdvanceCounter = 0f
init { init {
@@ -90,7 +89,11 @@ open class ParticleVanishingSprite(val sprite: TextureRegionPack, val delay: Flo
if (frameAdvanceCounter >= delay) { if (frameAdvanceCounter >= delay) {
frameAdvanceCounter -= delay frameAdvanceCounter -= delay
frame = (frame + 1) % sprite.horizontalCount
if (frame == sprite.horizontalCount - 1 && loop)
frame = 0
else if (frame != sprite.horizontalCount - 1)
frame += 1
} }
frameAdvanceCounter += delta frameAdvanceCounter += delta
} }

View File

@@ -71,7 +71,7 @@ internal class FixtureTikiTorch : FixtureBase, Luminous {
if (spawnTimer >= nextDelay) { if (spawnTimer >= nextDelay) {
(Terrarum.ingame as TerrarumIngame).addParticle(ParticleVanishingSprite( (Terrarum.ingame as TerrarumIngame).addParticle(ParticleVanishingSprite(
CommonResourcePool.getAsTextureRegionPack("particles-tiki_smoke.tga"), CommonResourcePool.getAsTextureRegionPack("particles-tiki_smoke.tga"),
0.25f, hitbox.centeredX, hitbox.startY + 5, rng.nextInt(256), false 0.25f, true, hitbox.centeredX, hitbox.startY, false, rng.nextInt(256)
)) ))
spawnTimer -= nextDelay spawnTimer -= nextDelay