fixtures can be despawned by "mining" them

This commit is contained in:
minjaesong
2021-09-21 00:22:36 +09:00
parent c63b31e964
commit 26c71e691c
22 changed files with 79 additions and 63 deletions

View File

@@ -56,12 +56,14 @@ class ParticleVanishingText(val text: String, x: Double, y: Double, noCollision:
override fun drawBody(batch: SpriteBatch) {
if (!flagDespawn) {
val oldColour = batch.color.cpy()
batch.color = drawColour
lines.forEachIndexed { index, line ->
drawBodyInGoodPosition(hitbox.startX.toFloat(), hitbox.startY.toFloat() + TinyAlphNum.H * index) { x, y ->
TinyAlphNum.draw(batch, line, x, y )
}
}
batch.color = oldColour
}
}
}
@@ -102,10 +104,12 @@ open class ParticleVanishingSprite(val sprite: TextureRegionPack, val delay: Flo
override fun drawBody(batch: SpriteBatch) {
if (!flagDespawn) {
val oldColour = batch.color.cpy()
batch.color = drawColour
drawBodyInGoodPosition(hitbox.startX.toFloat(), hitbox.startY.toFloat()) { x, y ->
batch.draw(sprite.get(frame, row), x, y)
}
batch.color = oldColour
}
}
}