1
Fork 0
mirror of https://github.com/Cookie-CHR/OfficeMadness-LD51.git synced 2024-11-25 16:14:19 +00:00
office-madness/Scenes/Minigames/4.gd

26 lines
670 B
GDScript3
Raw Normal View History

2022-10-02 22:44:58 +00:00
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():
2022-10-02 23:26:06 +00:00
password = gen_unique_str(floor(8+0.02*GlobalTimer.seconds_passed))
2022-10-02 22:44:58 +00:00
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()