mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 03:54:06 +09:00
portalPoint to the world
This commit is contained in:
@@ -150,6 +150,13 @@ open class FixtureBase : ActorWithBody, CuedByTerrainChange {
|
||||
protected constructor() : super(RenderOrder.BEHIND, PhysProperties.IMMOBILE, null)
|
||||
protected constructor(renderOrder: RenderOrder, physProp: PhysProperties, id: ActorID?) : super(renderOrder, physProp, id)
|
||||
|
||||
/**
|
||||
* Callend whenever the fixture was spawned successfully.
|
||||
*
|
||||
* @param tx bottom-centre tilewise point of the spawned fixture
|
||||
* @param ty bottom-centre tilewise point of the spawned fixture
|
||||
*/
|
||||
open fun onSpawn(tx: Int, ty: Int) {}
|
||||
|
||||
/**
|
||||
* Making the sprite: do not address the CommonResourcePool directly; just do it like this snippet:
|
||||
@@ -278,6 +285,8 @@ open class FixtureBase : ActorWithBody, CuedByTerrainChange {
|
||||
|
||||
actorThatInstalledThisFixture = installersUUID
|
||||
|
||||
onSpawn(posX0, posY0)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package net.torvald.terrarum.modulebasegame.gameactors
|
||||
|
||||
import net.torvald.random.XXHash64
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.App.printdbg
|
||||
import net.torvald.terrarum.INGAME
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.WireCodex
|
||||
import net.torvald.terrarum.gameactors.AVKey
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
@@ -111,6 +108,10 @@ class FixtureWorldPortal : Electric {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSpawn(tx: Int, ty: Int) {
|
||||
INGAME.world.portalPoint = Point2i(tx, ty)
|
||||
}
|
||||
|
||||
override fun reload() {
|
||||
super.reload()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user