bigger torch flame sprite; basic physics on particles

This commit is contained in:
minjaesong
2021-08-17 20:51:25 +09:00
parent a2b3334692
commit 9a271b1b9e
6 changed files with 24 additions and 19 deletions

View File

@@ -12,7 +12,7 @@ import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
* @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
*/
open class ParticleVanishingTexture(val tex: TextureRegion, x: Double, y: Double) : ParticleBase(Actor.RenderOrder.OVERLAY, false, 2f) {
open class ParticleVanishingTexture(val tex: TextureRegion, x: Double, y: Double, noCollision: Boolean = true) : ParticleBase(Actor.RenderOrder.OVERLAY, false, noCollision, 2f) {
init {
velocity.set(0.0, -1.0)
@@ -36,7 +36,7 @@ open class ParticleVanishingTexture(val tex: TextureRegion, x: Double, y: Double
* @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
*/
class ParticleVanishingText(val text: String, x: Double, y: Double) : ParticleBase(Actor.RenderOrder.OVERLAY, false, 2f) {
class ParticleVanishingText(val text: String, x: Double, y: Double, noCollision: Boolean = true) : ParticleBase(Actor.RenderOrder.OVERLAY, false, noCollision, 2f) {
private val lines = text.split('\n')
@@ -69,7 +69,7 @@ class ParticleVanishingText(val text: String, x: Double, y: Double) : ParticleBa
* @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
*/
open class ParticleVanishingSprite(val sprite: TextureRegionPack, val delay: Float, x: Double, y: Double, val start: Int = 0) : ParticleBase(Actor.RenderOrder.OVERLAY, false, 2f) {
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) {
private var row = 0
private var frame = start % sprite.horizontalCount