diff options
-rw-r--r-- | scenes/introduction/check_mail.gd | 6 | ||||
-rw-r--r-- | scenes/introduction/check_mail.tscn | 10 |
2 files changed, 15 insertions, 1 deletions
diff --git a/scenes/introduction/check_mail.gd b/scenes/introduction/check_mail.gd index 4474f39..a2b20c4 100644 --- a/scenes/introduction/check_mail.gd +++ b/scenes/introduction/check_mail.gd @@ -2,6 +2,7 @@ extends Node2D onready var passwordfield = $password var trys = 0 +var correct = "correct" func _ready(): pass # Replace with function body. @@ -11,7 +12,7 @@ func login(): get_tree().change_scene("res://scenes/introduction/mail.tscn") func check_pw(): - if passwordfield.text == "correct": + if passwordfield.text == correct: login() else: if passwordfield.text == "deeper" or trys == 10: @@ -20,6 +21,9 @@ func check_pw(): if trys == 20: $Monolog3.start() $Monolog2.visible = false + if trys == 30: + $Reset.visible = true + correct = "tom" trys = trys + 1 $Incorrect.visible = true passwordfield.text = "" diff --git a/scenes/introduction/check_mail.tscn b/scenes/introduction/check_mail.tscn index b1b9fbb..6f6c1e2 100644 --- a/scenes/introduction/check_mail.tscn +++ b/scenes/introduction/check_mail.tscn @@ -97,6 +97,16 @@ __meta__ = { "_edit_use_anchors_": false } +[node name="Reset" type="Label" parent="."] +visible = false +margin_left = 306.457 +margin_top = 52.6645 +margin_right = 995.457 +margin_bottom = 84.6645 +text = "Too many trys. Password was reset to \"tom\"" +__meta__ = { +"_edit_use_anchors_": false +} [connection signal="text_changed" from="password" to="." method="_on_password_text_changed"] [connection signal="text_entered" from="password" to="." method="_on_password_text_entered"] [connection signal="on_click" from="Log in" to="." method="_on_Log_in_on_click"] |