tweaks to playlist loader, working on preventing reentry to levels in round
This commit is contained in:
@@ -19,6 +19,7 @@ var last_leaderboard_id = 0
|
||||
var user_names = ["Profile 1","Profile 2","Profile 3","Profile 4","Profile 5"]
|
||||
var all_user_leaderboards = [["Global"]]
|
||||
var current_leaderboard_name = all_user_leaderboards[user_id][last_leaderboard_id]
|
||||
var no_reentry_portals = []
|
||||
|
||||
var playlist_test
|
||||
var current_match
|
||||
|
||||
@@ -4,10 +4,12 @@ extends Node3D
|
||||
|
||||
@onready var level_name: Label3D = $"Level Name"
|
||||
@onready var gamemode_label: Label3D = $Gamemode
|
||||
@onready var active: Label3D = $Active
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
level_name.text = portal_node.scene_name
|
||||
gamemode_label.text = portal_node.level_gamemode.gamemode_name
|
||||
active.text = str("ACTIVE: ",portal_node.active)
|
||||
|
||||
func update_sign_names():
|
||||
level_name.text = portal_node.scene_name
|
||||
|
||||
@@ -13,9 +13,13 @@ func _ready() -> void:
|
||||
if i.is_in_group("portal"):
|
||||
portals.append(i)
|
||||
|
||||
print("NO REENTRY PORTALS : ",GameGlobals.no_reentry_portals)
|
||||
|
||||
var id = 0
|
||||
for i in portals:
|
||||
i.scene_path = str(GameGlobals.current_match[round_id][id]["level_path"])
|
||||
i.scene_name = str(GameGlobals.current_match[round_id][id]["level_name"])
|
||||
i.level_gamemode = load(GameGlobals.current_match[round_id][id]["gamemode_path"])
|
||||
if !GameGlobals.no_reentry_portals.has(Vector2(round_id,id)):
|
||||
i.round_id = Vector2(round_id,id)
|
||||
i.scene_path = str(GameGlobals.current_match[round_id][id]["level_path"])
|
||||
i.scene_name = str(GameGlobals.current_match[round_id][id]["level_name"])
|
||||
i.level_gamemode = load(GameGlobals.current_match[round_id][id]["gamemode_path"])
|
||||
id += 1
|
||||
|
||||
@@ -62,6 +62,7 @@ func save_user_data():
|
||||
file.store_var(GameGlobals.last_hit_path)
|
||||
file.store_var(leaderboard_name)
|
||||
file.store_var(GameGlobals.current_level)
|
||||
file.store_var(GameGlobals.no_reentry_portals)
|
||||
file.store_var(money)
|
||||
file.store_var(deposited_money)
|
||||
file.store_var(health)
|
||||
@@ -94,6 +95,7 @@ func load_user_data():
|
||||
GameGlobals.last_hit_path = file.get_var()
|
||||
var file_leaderboard_name = file.get_var()
|
||||
GameGlobals.current_level = str(file.get_var())
|
||||
GameGlobals.no_reentry_portals = file.get_var()
|
||||
var money = set_nulls_zero(file.get_var())
|
||||
var deposited_money = set_nulls_zero(file.get_var())
|
||||
var health = file.get_var()
|
||||
|
||||
@@ -7,6 +7,7 @@ class_name Portal
|
||||
@export var scene_thumbnail : Texture2D
|
||||
|
||||
var active = false
|
||||
var round_id : Vector2
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
@@ -20,6 +21,7 @@ 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
|
||||
|
||||
Reference in New Issue
Block a user