From c83dfac266720733909995583bb528b2357414f2 Mon Sep 17 00:00:00 2001 From: rom Date: Mon, 26 Apr 2021 18:13:08 +0200 Subject: cross platform text checks uwu --- scenes/levels/typeracer.gd | 7 ++++--- scenes/levels/typeracer.tscn | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scenes/levels/typeracer.gd b/scenes/levels/typeracer.gd index 5634810..6c0a63a 100644 --- a/scenes/levels/typeracer.gd +++ b/scenes/levels/typeracer.gd @@ -18,14 +18,15 @@ func _total_time(): return 20 func _process(delta): - if running: - timer += delta + if not running: + return + timer += delta timer_label.text = str(total - timer) if timer >= total: eval() func eval(): - if $Label.text == $TextEdit.text: + if $Label.text.replace('\r\n', '\n').replace('\r', '\n') == $TextEdit.text.replace('\r\n', '\n').replace('\r', '\n'): finish_level() else: lose_heart() diff --git a/scenes/levels/typeracer.tscn b/scenes/levels/typeracer.tscn index 3d2aad7..2d87225 100644 --- a/scenes/levels/typeracer.tscn +++ b/scenes/levels/typeracer.tscn @@ -59,4 +59,5 @@ text = "The text you wrote is not exactely correct" __meta__ = { "_edit_use_anchors_": false } + [connection signal="on_click" from="Button" to="." method="_on_Button_on_click"] -- cgit