mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 20:14:05 +09:00
new save format wip (no branching on this commit)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package net.torvald.terrarum.modulebasegame.gameactors
|
||||
|
||||
import com.badlogic.gdx.Gdx
|
||||
import net.torvald.spriteanimation.HasAssembledSprite
|
||||
import net.torvald.spriteassembler.ADProperties
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.gameactors.AVKey
|
||||
|
||||
@@ -13,15 +15,15 @@ import net.torvald.terrarum.gameactors.AVKey
|
||||
|
||||
class IngamePlayer : ActorHumanoid, HasAssembledSprite {
|
||||
|
||||
override var animDescPath = "invalid"
|
||||
override var animDescPathGlow: String? = null
|
||||
override var animDesc: ADProperties? = null
|
||||
override var animDescGlow: ADProperties? = null
|
||||
internal var worldCurrentlyPlaying = 0 // only filled up on save and load; DO NOT USE THIS
|
||||
|
||||
private constructor()
|
||||
|
||||
constructor(animDescPath: String, animDescPathGlow: String?, born: Long) : super(born) {
|
||||
this.animDescPath = animDescPath
|
||||
this.animDescPathGlow = animDescPathGlow
|
||||
animDesc = ADProperties(Gdx.files.internal(animDescPath))
|
||||
if (animDescPathGlow != null) animDescGlow = ADProperties(Gdx.files.internal(animDescPathGlow))
|
||||
actorValue[AVKey.__HISTORICAL_BORNTIME] = born
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ object PlayerBuilderTestSubject1 {
|
||||
|
||||
p.sprite = SpriteAnimation(p)
|
||||
p.spriteGlow = SpriteAnimation(p)
|
||||
p.reassembleSprite(p.sprite!!, p.spriteGlow)
|
||||
p.reassembleSprite(p.sprite, p.animDesc, p.spriteGlow, p.animDescGlow)
|
||||
p.setHitboxDimension(15, p.actorValue.getAsInt(AVKey.BASEHEIGHT) ?: ActorHumanoid.BASE_HEIGHT, 21, 0)
|
||||
|
||||
// ingame must teleport the player to the spawn point
|
||||
|
||||
@@ -31,7 +31,7 @@ object PlayerBuilderWerebeastTest {
|
||||
|
||||
p.sprite = SpriteAnimation(p)
|
||||
p.spriteGlow = SpriteAnimation(p)
|
||||
p.reassembleSprite(p.sprite!!, p.spriteGlow)
|
||||
p.reassembleSprite(p.sprite, p.animDesc, p.spriteGlow, p.animDescGlow)
|
||||
p.setHitboxDimension(22, p.actorValue.getAsInt(AVKey.BASEHEIGHT)!!, 30, 0)
|
||||
|
||||
p.setPosition(3.0 * TILE_SIZE, 3.0 * TILE_SIZE)
|
||||
|
||||
Reference in New Issue
Block a user