summaryrefslogtreecommitdiff
path: root/scenes
diff options
context:
space:
mode:
authorJonas Bernard <public.jbernard@web.de>2021-04-25 23:10:04 +0200
committerJonas Bernard <public.jbernard@web.de>2021-04-25 23:10:04 +0200
commitfafd4fc6a6bcd0ac8191f62c315db46dea26864f (patch)
treee11e368ba6157b247d32b59c15fcf43ab4ca0aa3 /scenes
parentaa3fc5b6f975e93ff0e2b71639be6451d5e06420 (diff)
downloadldjam48-fafd4fc6a6bcd0ac8191f62c315db46dea26864f.tar.gz
ldjam48-fafd4fc6a6bcd0ac8191f62c315db46dea26864f.tar.bz2
ldjam48-fafd4fc6a6bcd0ac8191f62c315db46dea26864f.zip
New checkmail
Diffstat (limited to 'scenes')
-rw-r--r--scenes/introduction/check_mail.gd35
-rw-r--r--scenes/introduction/check_mail.tscn4
2 files changed, 37 insertions, 2 deletions
diff --git a/scenes/introduction/check_mail.gd b/scenes/introduction/check_mail.gd
new file mode 100644
index 0000000..4474f39
--- /dev/null
+++ b/scenes/introduction/check_mail.gd
@@ -0,0 +1,35 @@
+extends Node2D
+
+onready var passwordfield = $password
+var trys = 0
+
+func _ready():
+ pass # Replace with function body.
+
+func login():
+ $Incorrect.visible = false
+ get_tree().change_scene("res://scenes/introduction/mail.tscn")
+
+func check_pw():
+ if passwordfield.text == "correct":
+ login()
+ else:
+ if passwordfield.text == "deeper" or trys == 10:
+ $Monolog2.start()
+ $Monolog1.visible = false
+ if trys == 20:
+ $Monolog3.start()
+ $Monolog2.visible = false
+ trys = trys + 1
+ $Incorrect.visible = true
+ passwordfield.text = ""
+
+func _on_password_text_changed(new_text):
+ $Incorrect.visible = false
+
+
+func _on_password_text_entered(new_text):
+ check_pw()
+
+func _on_Log_in_on_click():
+ check_pw()
diff --git a/scenes/introduction/check_mail.tscn b/scenes/introduction/check_mail.tscn
index 6983820..eccdf90 100644
--- a/scenes/introduction/check_mail.tscn
+++ b/scenes/introduction/check_mail.tscn
@@ -1,6 +1,6 @@
[gd_scene load_steps=6 format=2]
-[ext_resource path="res://components/Level.gd" type="Script" id=1]
+[ext_resource path="res://scenes/introduction/check_mail.gd" type="Script" id=1]
[ext_resource path="res://components/card/card.gd" type="Script" id=2]
[ext_resource path="res://fonts/Flipps_Theme.tres" type="Theme" id=3]
[ext_resource path="res://components/textrevealbox.tscn" type="PackedScene" id=4]
@@ -98,4 +98,4 @@ __meta__ = {
}
[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_Button_on_click"]
+[connection signal="on_click" from="Log in" to="." method="_on_Log_in_on_click"]