mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
big smoke texture
This commit is contained in:
BIN
assets/mods/basegame/particles/bigger_smoke.tga
LFS
Normal file
BIN
assets/mods/basegame/particles/bigger_smoke.tga
LFS
Normal file
Binary file not shown.
BIN
assets/test_texture.tga
LFS
BIN
assets/test_texture.tga
LFS
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 |
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user