refactor: add ticks to DeltaTime, rewrite Blinking system for tick-based calculations with absolute calculations, rewrite Blinking/Direction tests

This commit is contained in:
Ryan Walters
2025-09-05 19:20:58 -05:00
parent 132067c573
commit 3c50bfeab6
15 changed files with 413 additions and 76 deletions

View File

@@ -232,7 +232,7 @@ fn test_player_movement_system_buffered_direction_expires() {
});
// Set delta time to expire the buffered direction
world.insert_resource(DeltaTime(0.02));
world.insert_resource(DeltaTime::from_seconds(0.02));
// Run the system
world
@@ -410,7 +410,7 @@ fn test_buffered_direction_timing() {
.expect("System should run successfully");
// Run movement system multiple times with small delta times
world.insert_resource(DeltaTime(0.1)); // 0.1 seconds
world.insert_resource(DeltaTime::from_seconds(0.1)); // 0.1 seconds
// First run - buffered direction should still be active
world
@@ -428,7 +428,7 @@ fn test_buffered_direction_timing() {
}
// Run again to fully expire the buffered direction
world.insert_resource(DeltaTime(0.2)); // Total 0.3 seconds, should expire
world.insert_resource(DeltaTime::from_seconds(0.2)); // Total 0.3 seconds, should expire
world
.run_system_once(player_movement_system)
.expect("System should run successfully");