diff options
author | rom <romangraef@gmail.com> | 2021-04-26 18:13:08 +0200 |
---|---|---|
committer | rom <romangraef@gmail.com> | 2021-04-26 18:13:15 +0200 |
commit | c83dfac266720733909995583bb528b2357414f2 (patch) | |
tree | 6f5b874f429dadd9a891a354190d5aa7b37f890b | |
parent | c7c43f21c67c13963fb7e62475377f12108b3b7f (diff) | |
download | ldjam48-c83dfac266720733909995583bb528b2357414f2.tar.gz ldjam48-c83dfac266720733909995583bb528b2357414f2.tar.bz2 ldjam48-c83dfac266720733909995583bb528b2357414f2.zip |
cross platform text checks uwu
-rw-r--r-- | scenes/levels/typeracer.gd | 7 | ||||
-rw-r--r-- | 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"] |