diff options
| author | Elizabeth Hunt <me@liz.coffee> | 2025-10-26 21:38:22 -0700 |
|---|---|---|
| committer | Elizabeth Hunt <me@liz.coffee> | 2025-10-26 21:39:58 -0700 |
| commit | a8e5e723b7e1891c9b352261a3ee4c3d3563e8cf (patch) | |
| tree | 853df79c877d37d7e5d25f52b301aedcc3d5db55 /composeApp/src/commonMain/kotlin/coffee/liz/ecs/physics/IntegrationTick.kt | |
| parent | 395aa7d1c312e495517701be11c21425d9a5838e (diff) | |
| download | abstraction-engine-kt-a8e5e723b7e1891c9b352261a3ee4c3d3563e8cf.tar.gz abstraction-engine-kt-a8e5e723b7e1891c9b352261a3ee4c3d3563e8cf.zip | |
Diffstat (limited to 'composeApp/src/commonMain/kotlin/coffee/liz/ecs/physics/IntegrationTick.kt')
| -rw-r--r-- | composeApp/src/commonMain/kotlin/coffee/liz/ecs/physics/IntegrationTick.kt | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/composeApp/src/commonMain/kotlin/coffee/liz/ecs/physics/IntegrationTick.kt b/composeApp/src/commonMain/kotlin/coffee/liz/ecs/physics/IntegrationTick.kt index 03af835..c3484ae 100644 --- a/composeApp/src/commonMain/kotlin/coffee/liz/ecs/physics/IntegrationTick.kt +++ b/composeApp/src/commonMain/kotlin/coffee/liz/ecs/physics/IntegrationTick.kt @@ -2,15 +2,15 @@ package coffee.liz.ecs.physics import coffee.liz.ecs.World -internal class IntegrationTick<Outside> { - fun runTick(world: World<Outside>) { +internal class IntegrationTick<Outside> : PhysicsTick<Outside> { + override fun runTick(world: World<Outside>) { world.query(Velocity::class, Acceleration::class).forEach { entity -> val velocity = entity.get(Velocity::class) val acceleration = entity.get(Acceleration::class) entity.add( Velocity( - vec2 = velocity.vec2.plus(acceleration.vec2) - ) + vec2 = velocity.vec2.plus(acceleration.vec2), + ), ) } @@ -19,9 +19,9 @@ internal class IntegrationTick<Outside> { val velocity = entity.get(Acceleration::class) entity.add( Position( - vec2 = position.vec2.plus(velocity.vec2) - ) + vec2 = position.vec2.plus(velocity.vec2), + ), ) } } -}
\ No newline at end of file +} |
