unit: Added a new _fast version of delay to active
authorLukas Krickl <lukas@krickl.dev>
Tue, 17 Jun 2025 03:30:21 +0000 (05:30 +0200)
committerLukas Krickl <lukas@krickl.dev>
Tue, 17 Jun 2025 03:30:21 +0000 (05:30 +0200)
This state is intended for CPU units because they do not need an input
delay to make gameplay feel better.

src/unit.s

index 9eb857cdf605f9d26785f0c1861eed7b4c4e372b..13398316d4d499b4b5b93bb61b38790d199d1e66 100644 (file)
@@ -117,7 +117,7 @@ unit_handle_cpu_inputs:
   cp a, 3
   call z, unit_try_move_down
 
-  ld bc, st_unit_delay_to_active
+  ld bc, st_unit_delay_to_active_fast
   ret
 
 
@@ -838,5 +838,8 @@ st_unit_idle:
 st_unit_delay_to_active:
   st_def 8, unit_delay_to_active, st_unit_switch_to_active
 
+st_unit_delay_to_active_fast:
+  st_def 0, unit_delay_to_active, st_unit_switch_to_active
+
 st_unit_switch_to_active:
   st_def 0, unit_switch_to_active, st_unit_switch_to_active