summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scenes/levels/typeracer.gd7
-rw-r--r--scenes/levels/typeracer.tscn1
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"]