fix turtles breaking after restart :/

This commit is contained in:
Haze Weathers 2023-10-08 16:16:24 -04:00
parent 071ff439b9
commit 172ecd3235

View file

@ -22,10 +22,6 @@ func _ready() -> void:
if Engine.editor_hint: if Engine.editor_hint:
return return
# scale to be in tiles
for i in spike_positions.size():
spike_positions[i] = spike_positions[i] * 8.0
func _process(delta: float) -> void: func _process(delta: float) -> void:
# update debug graphics in editor # update debug graphics in editor
if Engine.editor_hint and Engine.get_frames_drawn() % 10 == 0: if Engine.editor_hint and Engine.get_frames_drawn() % 10 == 0:
@ -52,7 +48,7 @@ func _physics_process(delta: float) -> void:
return return
# spike if close enough to an activation point # spike if close enough to an activation point
for spike_pos in spike_positions: for spike_pos in spike_positions:
if abs(pos_start + spike_pos - pos) <= 2.0: if abs(pos_start + (spike_pos * 8.0) - pos) <= 2.0:
spike() spike()
break break
# slightly different logic depending on forward/backwards unfortunately :I # slightly different logic depending on forward/backwards unfortunately :I