still working on the new savegame scheme

main game works fine, saving/loading will not be possible
This commit is contained in:
minjaesong
2021-10-07 17:43:23 +09:00
parent 6d8a7520ac
commit 3f9b41fd29
23 changed files with 200 additions and 86 deletions

View File

@@ -65,7 +65,7 @@ class BuildingMaker(batch: SpriteBatch) : IngameInstance(batch) {
private val timeNow = System.currentTimeMillis() / 1000
val gameWorld = GameWorld(1, 1024, 256, timeNow, timeNow)
val gameWorld = GameWorld(90*12, 90*4, timeNow, timeNow)
init {
// ghetto world for building

View File

@@ -348,9 +348,9 @@ open class TerrarumIngame(batch: SpriteBatch) : IngameInstance(batch) {
// init map as chosen size
val timeNow = App.getTIME_T()
world = GameWorld(1, worldParams.width, worldParams.height, timeNow, timeNow) // new game, so the creation time is right now
world = GameWorld(worldParams.width, worldParams.height, timeNow, timeNow) // new game, so the creation time is right now
world.generatorSeed = worldParams.worldGenSeed
gameworldIndices.add(world.worldIndex)
//gameworldIndices.add(world.worldIndex)
world.extraFields["basegame.economy"] = GameEconomy()
// generate terrain for the map

View File

@@ -5,6 +5,7 @@ import net.torvald.spriteanimation.HasAssembledSprite
import net.torvald.spriteassembler.ADProperties
import net.torvald.terrarum.Terrarum
import net.torvald.terrarum.gameactors.AVKey
import java.util.*
/**
@@ -15,9 +16,10 @@ import net.torvald.terrarum.gameactors.AVKey
class IngamePlayer : ActorHumanoid, HasAssembledSprite {
var UUID = UUID(0L,0L); private set
internal var worldCurrentlyPlaying: UUID = UUID(0L,0L) // only filled up on save and load; DO NOT USE THIS
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()
@@ -33,10 +35,10 @@ class IngamePlayer : ActorHumanoid, HasAssembledSprite {
* **Use PlayerFactory to build player!**
*/
init {
referenceID = Terrarum.PLAYER_REF_ID // forcibly set ID
referenceID = Terrarum.PLAYER_REF_ID // TODO assign random ID
density = BASE_DENSITY
collisionType = COLLISION_KINEMATIC
worldCurrentlyPlaying = Terrarum.ingame?.world?.worldIndex ?: 0
worldCurrentlyPlaying = Terrarum.ingame?.world?.worldIndex ?: UUID(0L,0L)
}
}