From 395aa7d1c312e495517701be11c21425d9a5838e Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sun, 26 Oct 2025 17:25:13 -0700 Subject: Checkpoint --- .../commonTest/kotlin/coffee/liz/ecs/DAGWorldTest.kt | 2 +- .../coffee/liz/ecs/animation/AnimationSystemTest.kt | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'composeApp/src/commonTest/kotlin') diff --git a/composeApp/src/commonTest/kotlin/coffee/liz/ecs/DAGWorldTest.kt b/composeApp/src/commonTest/kotlin/coffee/liz/ecs/DAGWorldTest.kt index 737e386..bdf7e99 100644 --- a/composeApp/src/commonTest/kotlin/coffee/liz/ecs/DAGWorldTest.kt +++ b/composeApp/src/commonTest/kotlin/coffee/liz/ecs/DAGWorldTest.kt @@ -34,7 +34,7 @@ class DAGWorldTest { val entity = world.createEntity() entity.add(Position(10f, 20f)) - world.destroyEntity(entity) + world.removeEntity(entity) val results = world.query() assertFalse(results.contains(entity)) diff --git a/composeApp/src/commonTest/kotlin/coffee/liz/ecs/animation/AnimationSystemTest.kt b/composeApp/src/commonTest/kotlin/coffee/liz/ecs/animation/AnimationSystemTest.kt index bb7298e..588e245 100644 --- a/composeApp/src/commonTest/kotlin/coffee/liz/ecs/animation/AnimationSystemTest.kt +++ b/composeApp/src/commonTest/kotlin/coffee/liz/ecs/animation/AnimationSystemTest.kt @@ -23,7 +23,7 @@ class AnimationSystemTest { clips = mapOf( AnimationName("idle") to AnimationClip( frameNames = listOf(FrameName("idle_0"), FrameName("idle_1")), - frameDuration = 0.1f, + frameTicks = 0.1f, loopMode = LoopMode.LOOP ), AnimationName("walk") to AnimationClip( @@ -32,7 +32,7 @@ class AnimationSystemTest { FrameName("walk_1"), FrameName("walk_2") ), - frameDuration = 0.15f, + frameTicks = 0.15f, loopMode = LoopMode.LOOP ) ), @@ -49,17 +49,17 @@ class AnimationSystemTest { entity.add(animator) assertEquals(0, animator.frameIndex) - assertEquals(0f, animator.elapsed) + assertEquals(0f, animator.elapsedTicks) // Update with less than frame duration - should not advance world.update(0.05f) assertEquals(0, animator.frameIndex) - assertEquals(0.05f, animator.elapsed) + assertEquals(0.05f, animator.elapsedTicks) // Update to exceed frame duration - should advance to frame 1 world.update(0.06f) assertEquals(1, animator.frameIndex) - assertTrue(animator.elapsed < 0.1f) + assertTrue(animator.elapsedTicks < 0.1f) } @Test @@ -87,7 +87,7 @@ class AnimationSystemTest { clips = mapOf( AnimationName("once") to AnimationClip( frameNames = listOf(FrameName("idle_0"), FrameName("idle_1")), - frameDuration = 0.1f, + frameTicks = 0.1f, loopMode = LoopMode.ONCE ) ), @@ -122,7 +122,7 @@ class AnimationSystemTest { FrameName("walk_1"), FrameName("walk_2") ), - frameDuration = 0.1f, + frameTicks = 0.1f, loopMode = LoopMode.PING_PONG ) ), @@ -164,13 +164,13 @@ class AnimationSystemTest { // Manually advance animator.frameIndex = 1 - animator.elapsed = 0.05f + animator.elapsedTicks = 0.05f // Switch to walk animation animator.play(AnimationName("walk")) assertEquals(AnimationName("walk"), animator.currentClip) assertEquals(0, animator.frameIndex) - assertEquals(0f, animator.elapsed) + assertEquals(0f, animator.elapsedTicks) assertEquals(1, animator.direction) assertTrue(animator.playing) } @@ -222,7 +222,7 @@ class AnimationSystemTest { // Large delta time should advance multiple frames world.update(0.25f) // Should advance 2 frames and have 0.05s remainder assertEquals(0, animator.frameIndex) // Wrapped back to 0 (LOOP mode) - assertTrue(animator.elapsed >= 0.04f && animator.elapsed <= 0.06f) + assertTrue(animator.elapsedTicks >= 0.04f && animator.elapsedTicks <= 0.06f) } @Test -- cgit v1.2.3-70-g09d2