summaryrefslogtreecommitdiff
path: root/scenes/LegallyDistinctPaperclipAssistant/paperclip.gd
blob: 66244987b91c6197c246f0c989ae532363160927 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
extends Window

signal intro_finished

const START_TEXT = "Hi, I'm your legally\ndistinct paperclip\nassistant,\nClippette..."
const TOUCHED = "Don't touch me!"

var angy: Sprite2D
var normal: Sprite2D
var hapi: Sprite2D
var label: Label
var timer: Timer
var panel: Panel

@export_multiline var current_text = START_TEXT

# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	angy = $Angy
	hapi = $Hapi
	normal = $Normal
	label = $Label
	timer = $Timer
	panel = $Panel
	
	normal.visible = true;


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta: float) -> void:
	if current_text == "":
		label.visible = false
		panel.visible = false
	else:
		label.text = "" # I hate this, but it does fix a bug
		label.text = current_text
		label.visible = true
		panel.visible = true


func _on_texture_button_button_up() -> void:
	normal.visible = false
	hapi.visible = false
	angy.visible = true
	current_text = TOUCHED
	timer.start()

func _on_timer_timeout() -> void:
	normal.visible = true
	hapi.visible = false
	angy.visible = false
	current_text = ""
	timer.stop()


func start_dialogue():
	$AnimationPlayer.play("intro")
	

func finish_intro():
	intro_finished.emit()