playlist now removes played scenes
This commit is contained in:
@@ -5,9 +5,11 @@ class_name Portal
|
||||
@export var scene_name : String
|
||||
@export var level_gamemode : gamemode
|
||||
@export var scene_thumbnail : Texture2D
|
||||
@export var hub_portal : bool = false
|
||||
|
||||
var active = false
|
||||
var round_id : Vector2
|
||||
var timer_active = false
|
||||
var active = true
|
||||
var index : int
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
@@ -20,18 +22,22 @@ func _process(delta: float) -> void:
|
||||
|
||||
|
||||
func _on_body_entered(body: Node3D) -> void:
|
||||
if active:
|
||||
GameGlobals.no_reentry_portals.append(round_id)
|
||||
#Let the Bounds detector know player is exiting
|
||||
SignalBus.emit_signal("player_exiting_tree")
|
||||
#Set incoming gamemode
|
||||
GameGlobals.loading_gamemode = level_gamemode
|
||||
#Save data
|
||||
if get_tree().current_scene.gamemode.load_save == true:
|
||||
SaveLoad.save_game_data(get_tree().current_scene.get_name())
|
||||
SaveLoad.save_user_data()
|
||||
get_tree().change_scene_to_file(scene_path)
|
||||
if body.is_in_group("player"):
|
||||
if active and timer_active:
|
||||
#Let the Bounds detector know player is exiting
|
||||
SignalBus.emit_signal("player_exiting_tree")
|
||||
|
||||
if hub_portal:
|
||||
#add back other portals to round portal array
|
||||
GameGlobals.current_match[GameGlobals.current_round_id].remove_at(index)
|
||||
#Set incoming gamemode
|
||||
GameGlobals.loading_gamemode = level_gamemode
|
||||
#Save data
|
||||
if get_tree().current_scene.gamemode.load_save == true:
|
||||
SaveLoad.save_game_data(get_tree().current_scene.get_name())
|
||||
SaveLoad.save_user_data()
|
||||
get_tree().change_scene_to_file(scene_path)
|
||||
|
||||
|
||||
func _on_start_activation_timeout() -> void:
|
||||
active = true
|
||||
timer_active = true
|
||||
|
||||
Reference in New Issue
Block a user