summaryrefslogtreecommitdiff
path: root/scenes/introduction/check_mail.gd
blob: 4474f39776f6f7f972e7944be3fedc571685f1d5 (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
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()