moving platform wip

This commit is contained in:
minjaesong
2022-02-28 17:54:07 +09:00
parent e8330af14a
commit 13003a63d3
3 changed files with 36 additions and 1 deletions

Binary file not shown.

View File

@@ -0,0 +1,29 @@
package net.torvald.terrarum.modulebasegame.gameactors
import net.torvald.terrarum.gameactors.ActorID
import net.torvald.terrarum.gameactors.ActorWithBody
/**
* Created by minjaesong on 2022-02-28.
*/
class ActorMovingPlatform() : ActorWithBody() {
private val tilewiseLength = 3
private val actorsRiding = ArrayList<ActorID>() // saving actorID due to serialisation issues
/**
* Make the actor its externalV controlled by this platform
*/
fun mount(actor: ActorWithBody) {
actorsRiding.add(actor.referenceID)
}
/**
* Make the actor its externalV no longer controlled by this platform
*/
fun dismount(actor: ActorWithBody) {
actorsRiding.remove(actor.referenceID)
}
}

View File

@@ -130,7 +130,10 @@ open class FixtureBase : ActorWithBody, CuedByTerrainChange {
}
}
if (hasCollision) return false
if (hasCollision) {
printdbg(this, "cannot spawn fixture ${nameFun()}, has tile collision; tilewise dim: (${blockBox.width}, ${blockBox.height}) ")
return false
}
printdbg(this, "spawn fixture ${nameFun()}, tilewise dim: (${blockBox.width}, ${blockBox.height})")