mirror of
https://github.com/Cookie-CHR/OfficeMadness-LD51.git
synced 2024-11-22 06:44:18 +00:00
25 lines
670 B
GDScript3
25 lines
670 B
GDScript3
extends Node2D
|
|
|
|
|
|
# Declare member variables here. Examples:
|
|
# var a = 2
|
|
# var b = "text"
|
|
var password
|
|
var ascii_letters_and_digits = "abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
password = gen_unique_str(floor(8+0.02*GlobalTimer.seconds_passed))
|
|
get_node("Label").text = password
|
|
pass # Replace with function body.
|
|
|
|
|
|
func gen_unique_str(length):
|
|
var result = ""
|
|
for _i in range(length):
|
|
result += ascii_letters_and_digits[randi() % ascii_letters_and_digits.length()]
|
|
return result
|
|
|
|
func confront():
|
|
if get_node("TextEdit").text == password:
|
|
MManager.on_finished()
|