-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworld.gd
30 lines (23 loc) · 820 Bytes
/
world.gd
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
extends Node2D
class_name World
@export var boss_name = ""
@export var background_color: Color = Color.BLACK
@export var shadow_color: Color = Color.BLACK
@export var portal_color: Color = Color.WHITE
@export var boss_health_color: Color = Color.PALE_VIOLET_RED
var portal_scene = preload("res://portal.tscn")
func _enter_tree() -> void:
Globals.world = self
func _ready() -> void:
RenderingServer.set_default_clear_color(background_color)
Events.boss_defeated.connect(_on_boss_defeated)
Globals.mouse.change_texture(Mouse.MODE.CROSSHAIR)
Globals.canvas.set_boss_name(boss_name)
Scoring.boss_timer = 0
await Globals.wait(1.5)
AudioManager.beat_target_volume = 1
func _on_boss_defeated():
await Globals.wait(1.0)
var portal = portal_scene.instantiate()
portal.position = Vector2.ZERO
add_child(portal)