platform wip3

This commit is contained in:
minjaesong
2026-02-08 20:02:39 +09:00
parent 5b1d0ca049
commit b5b9e22091
5 changed files with 222 additions and 169 deletions

View File

@@ -1480,16 +1480,16 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
actorNowPlaying?.update(delta)*/
}
else {
// Pass 1: update moving platforms first so riders get displaced before their own update
// Pass 1: update contraptions first so riders get displaced before their own update
actorContainerActive.forEach {
if (it is ActorMovingPlatform && it != actorNowPlaying) {
if (it is PhysContraption && it != actorNowPlaying) {
it.update(delta)
}
}
// Pass 2: update all non-platform actors with existing callbacks
// Pass 2: update all non-contraption actors with existing callbacks
actorContainerActive.forEach {
if (it !is ActorMovingPlatform && it != actorNowPlaying) {
if (it !is PhysContraption && it != actorNowPlaying) {
it.update(delta)
if (it is Pocketed) {

View File

@@ -51,24 +51,24 @@ class ActorTestPlatform : ActorMovingPlatform(8) {
// Horizontal pingpong: position = A * sin(phase)
// Velocity = finite difference to prevent float drift
val dx = amplitude * (sin(phase) - sin(oldPhase))
platformVelocity.set(dx, 0.0)
contraptionVelocity.set(dx, 0.0)
}
1 -> {
// Vertical pingpong: position = A * sin(phase)
val dy = amplitude * (sin(phase) - sin(oldPhase))
platformVelocity.set(0.0, dy)
contraptionVelocity.set(0.0, dy)
}
2 -> {
// Clockwise circular: position on circle (cos, sin)
val dx = amplitude * (cos(phase) - cos(oldPhase))
val dy = amplitude * (sin(phase) - sin(oldPhase))
platformVelocity.set(dx, dy)
contraptionVelocity.set(dx, dy)
}
3 -> {
// Counter-clockwise circular: negate Y component
val dx = amplitude * (cos(phase) - cos(oldPhase))
val dy = -(amplitude * (sin(phase) - sin(oldPhase)))
platformVelocity.set(dx, dy)
contraptionVelocity.set(dx, dy)
}
}