summaryrefslogtreecommitdiff
path: root/scenes/introduction/check_mail.gd
blob: a2b20c4d5d0f607ce7a303ef70a36251cc5f2316 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
extends Node2D

onready var passwordfield = $password
var trys = 0
var correct = "correct"

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
		if trys == 30:
			$Reset.visible = true
			correct = "tom"
		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()