Unbork some very borked stuff
This commit is contained in:
@@ -1,14 +1,23 @@
|
||||
class_name Exit
|
||||
extends Node2D
|
||||
|
||||
@export
|
||||
var area: Area2D
|
||||
|
||||
func _ready():
|
||||
@export
|
||||
var victory_scene: PackedScene
|
||||
|
||||
func _ready() -> void:
|
||||
area.body_entered.connect(self._on_body_entered)
|
||||
$Area2D.connect("body_entered",Callable(self,"on_collide"))
|
||||
|
||||
|
||||
func on_collide(body):
|
||||
if body.has_method("victoryCondition"):
|
||||
func _on_body_entered(body: PhysicsBody2D) -> void:
|
||||
if body is Player:
|
||||
MusicPlayer.stop()
|
||||
MusicPlayer.stream = load("res://Music/DOS-88/Smooth Sailing.ogg")
|
||||
MusicPlayer.volume_db = 0
|
||||
MusicPlayer.play()
|
||||
body.victoryCondition()
|
||||
SaveManager.change_upgrade_points(1)
|
||||
get_tree().change_scene_to_packed(victory_scene)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user