playlist now removes played scenes
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
[gd_resource type="Resource" script_class="gamemode" load_steps=2 format=3 uid="uid://dlvhtdmtln3bb"]
|
||||
[gd_resource type="Resource" script_class="gamemode" load_steps=2 format=3 uid="uid://cwwvseoidm6ha"]
|
||||
|
||||
[ext_resource type="Script" path="res://gamemode.gd" id="1_lcpua"]
|
||||
[ext_resource type="Script" path="res://gamemode.gd" id="1_3d3uh"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_lcpua")
|
||||
gamemode_name = "DO NOT GET HIT"
|
||||
estimated_difficulty = 0
|
||||
win_conditions = 2
|
||||
script = ExtResource("1_3d3uh")
|
||||
gamemode_name = "Standard"
|
||||
estimated_difficulty = 4
|
||||
win_conditions = 0
|
||||
survival_time = 160.0
|
||||
money_lost_multiplier = 0.5
|
||||
weapon_penalty = 0
|
||||
@@ -15,9 +15,9 @@ ammo_drop_percentage = 0.5
|
||||
walk_speed = 12.0
|
||||
jump_velocity = 5
|
||||
dash_speed = 40
|
||||
gravity = -18.0
|
||||
gravity = -9.8
|
||||
time_slowed_speed = 0.1
|
||||
stamina_regen = true
|
||||
stamina_regen = false
|
||||
max_stamina = 100.0
|
||||
stamina_drain = 20.0
|
||||
air_dash_max = 1
|
||||
@@ -4,13 +4,14 @@
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_2sia6")
|
||||
gamemode_name = "Standard"
|
||||
gamemode_name = "Standard with regen"
|
||||
estimated_difficulty = 0
|
||||
win_conditions = 0
|
||||
survival_time = 160.0
|
||||
money_lost_multiplier = 0.5
|
||||
weapon_penalty = 0
|
||||
weapon_drop_percentage = 0.5
|
||||
ammo_drop_percentage = 0.5
|
||||
walk_speed = 12.0
|
||||
jump_velocity = 5
|
||||
dash_speed = 40
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
[gd_scene load_steps=11 format=3 uid="uid://sa1d1rftyn87"]
|
||||
[gd_scene load_steps=16 format=3 uid="uid://sa1d1rftyn87"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/main_menu.gd" id="1_haaol"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpootbr7qgac1" path="res://Tools/playlist_generator.tscn" id="2_2rg1o"]
|
||||
[ext_resource type="Theme" uid="uid://clek42ofxr45f" path="res://DefaultTheme.tres" id="2_3fflq"]
|
||||
[ext_resource type="FontFile" uid="uid://d2h2tjhxiv5wo" path="res://assets/fonts/White On Black.ttf" id="2_ac165"]
|
||||
[ext_resource type="Shader" path="res://assets/crtTest.gdshader" id="2_hyw7c"]
|
||||
[ext_resource type="Script" path="res://gamemode.gd" id="4_p0ng4"]
|
||||
[ext_resource type="Theme" uid="uid://buma708jpxqrn" path="res://Clean_theme.tres" id="4_ydrbj"]
|
||||
[ext_resource type="Resource" uid="uid://dn3t7wcoumlm3" path="res://GameModes/standard.tres" id="5_lv7ko"]
|
||||
[ext_resource type="Resource" uid="uid://bs8yvpq65yh3w" path="res://GameModes/cookie_mode.tres" id="6_sxxvb"]
|
||||
[ext_resource type="Shader" path="res://assets/Shaders/blur.gdshader" id="6_x75tm"]
|
||||
[ext_resource type="Texture2D" uid="uid://bt6utik8unkxa" path="res://assets/Textures/ObjectTextures/money.png" id="7_ia0hc"]
|
||||
[ext_resource type="Resource" uid="uid://u32xafejp3rq" path="res://GameModes/standard_stam_regen.tres" id="7_vm4j1"]
|
||||
[ext_resource type="Resource" uid="uid://cwwvseoidm6ha" path="res://GameModes/DoNotGetHit.tres" id="8_bexpg"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_a5tps"]
|
||||
shader = ExtResource("2_hyw7c")
|
||||
@@ -55,6 +60,8 @@ offset_bottom = 2160.0
|
||||
[node name="PlaylistGenerator" parent="." instance=ExtResource("2_2rg1o")]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
gamemodes_in_rotation = Array[ExtResource("4_p0ng4")]([ExtResource("5_lv7ko"), ExtResource("6_sxxvb"), ExtResource("7_vm4j1"), ExtResource("8_bexpg")])
|
||||
levels_per_round = 4
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
layout_mode = 1
|
||||
|
||||
@@ -192,24 +192,25 @@ transform = Transform3D(22.6681, 0, 0, 0, 3.41912, 0, 0, 0, 6.68795, 16.4442, -5
|
||||
scene_path = "res://scenes/enemy_working_scene.tscn"
|
||||
scene_name = "Enemy Working Scene"
|
||||
level_gamemode = ExtResource("6_t16kj")
|
||||
hub_portal = true
|
||||
|
||||
[node name="Blockout2" parent="." instance=ExtResource("5_alya6")]
|
||||
transform = Transform3D(0.100323, 0, 16.2141, 0, 30.4856, 0, -22.8099, 0, 0.0713132, -17.949, -57.3609, -2.74808)
|
||||
scene_path = "res://assets/blockout_2.tscn"
|
||||
scene_name = "Blockout 2"
|
||||
level_gamemode = ExtResource("6_t16kj")
|
||||
hub_portal = true
|
||||
|
||||
[node name="Gulag of Money" parent="." instance=ExtResource("5_alya6")]
|
||||
transform = Transform3D(22.8101, 0, 0, 0, 30.4856, 0, 0, 0, 16.2143, -0.602371, -57.3609, 24.0114)
|
||||
scene_path = "res://scenes/Arena of Money.tscn"
|
||||
scene_name = "The Gulag"
|
||||
level_gamemode = ExtResource("6_pf4wj")
|
||||
hub_portal = true
|
||||
|
||||
[node name="TestLevel2v2" parent="." instance=ExtResource("5_alya6")]
|
||||
transform = Transform3D(22.8101, 0, 0, 0, 30.4856, 0, 0, 0, 16.2143, 0.74234, -57.3609, -22.7822)
|
||||
scene_path = "res://scenes/test_level_2v2.tscn"
|
||||
scene_name = "Test Level 2v2"
|
||||
level_gamemode = ExtResource("6_t16kj")
|
||||
hub_portal = true
|
||||
|
||||
[node name="Stats" parent="." instance=ExtResource("6_mkn70")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.212402, 1.9891, -6.02898)
|
||||
|
||||
@@ -19,10 +19,11 @@ 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
|
||||
var current_match_id = 0
|
||||
var current_round_id = 0
|
||||
var playlist_test
|
||||
|
||||
|
||||
#Player Stats
|
||||
var player_deaths = 0
|
||||
|
||||
@@ -7,9 +7,15 @@ extends Node3D
|
||||
@onready var active: Label3D = $Active
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if portal_node.active:
|
||||
level_name.text = portal_node.scene_name
|
||||
if portal_node.level_gamemode != null:
|
||||
gamemode_label.text = portal_node.level_gamemode.gamemode_name
|
||||
active.text = str("ACTIVE: ",portal_node.active)
|
||||
active.text = str("active: ",portal_node.active)
|
||||
else:
|
||||
level_name.text = "closed for maintenance"
|
||||
gamemode_label.text = "-"
|
||||
active.text = "active: closed"
|
||||
|
||||
func update_sign_names():
|
||||
level_name.text = portal_node.scene_name
|
||||
|
||||
@@ -126,7 +126,6 @@ var controlled_elsewhere = false
|
||||
@onready var hurt_audio = $Audio/Hurt
|
||||
@onready var hit_indicator: AudioStreamPlayer = $Audio/HitIndicator
|
||||
@onready var health_indicator = $HealthIndicator
|
||||
@onready var ammo_counter = $Head/Recoil/Camera3D/AmmoCounter
|
||||
@onready var stamina_counter = $Head/Recoil/Camera3D/StaminaCounter
|
||||
@onready var recoil: Node3D = $Head/Recoil
|
||||
@onready var weapon_spawner = $Head/Recoil/Camera3D/WeaponHolder/WeaponSpawner
|
||||
@@ -490,7 +489,7 @@ func _physics_process(delta):
|
||||
level_control.die()
|
||||
|
||||
focus_on_target()
|
||||
joypad_look(delta)
|
||||
joypad_look()
|
||||
aim_down_sights(delta)
|
||||
flashlight_toggle()
|
||||
hold_item(delta)
|
||||
@@ -514,7 +513,7 @@ func joypad_walk():
|
||||
|
||||
return dir_out
|
||||
|
||||
func joypad_look(delta):
|
||||
func joypad_look():
|
||||
if !controlled_elsewhere:
|
||||
# Joypad right stick look control
|
||||
var xAxis = Input.get_joy_axis(0,JOY_AXIS_RIGHT_X)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
@tool
|
||||
extends Node
|
||||
|
||||
@export var generate_playlist_now = false
|
||||
@@ -10,20 +9,6 @@ extends Node
|
||||
@export var rounds_per_match : int = 3
|
||||
@export var matches_per_year : int = 52
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
if generate_playlist_now == true:
|
||||
generate_playlist()
|
||||
|
||||
if load_playlist_from_file == true:
|
||||
load_playlist()
|
||||
|
||||
|
||||
func generate_playlist() -> void:
|
||||
var playlist_name = only_valid_chars(GameGlobals.all_user_leaderboards[GameGlobals.user_id][GameGlobals.last_leaderboard_id])
|
||||
var playlist = []
|
||||
|
||||
@@ -2,24 +2,39 @@ extends Node
|
||||
|
||||
@onready var playlist_generator: Control = $"../Playlist Generator"
|
||||
|
||||
var round_id = 2
|
||||
var portals = []
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
if GameGlobals.current_match == [] or GameGlobals.current_match == null:
|
||||
playlist_generator.load_playlist()
|
||||
|
||||
print("CURRENT MATCH : ",GameGlobals.current_match)
|
||||
for i in get_tree().current_scene.get_children():
|
||||
if i.is_in_group("portal"):
|
||||
portals.append(i)
|
||||
|
||||
print("NO REENTRY PORTALS : ",GameGlobals.no_reentry_portals)
|
||||
if GameGlobals.current_match[GameGlobals.current_round_id].size() == 0:
|
||||
var next_round = GameGlobals.current_round_id + 1
|
||||
if next_round <= (GameGlobals.current_match.size() - 1):
|
||||
GameGlobals.current_round_id = next_round
|
||||
|
||||
|
||||
var id = 0
|
||||
for i in portals:
|
||||
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"])
|
||||
if id <= (GameGlobals.current_match[GameGlobals.current_round_id].size() - 1):
|
||||
if GameGlobals.current_match[GameGlobals.current_round_id][id] != null:
|
||||
var level_spawn = GameGlobals.current_match[GameGlobals.current_round_id][id]
|
||||
i.index = id
|
||||
i.active = true
|
||||
i.scene_path = str(level_spawn["level_path"])
|
||||
i.scene_name = str(level_spawn["level_name"])
|
||||
i.level_gamemode = load(level_spawn["gamemode_path"])
|
||||
else:
|
||||
i.active = false
|
||||
i.scene_name = "closed"
|
||||
else:
|
||||
i.active = false
|
||||
i.scene_name = "closed"
|
||||
id += 1
|
||||
SaveLoad.save_user_data()
|
||||
|
||||
@@ -62,7 +62,9 @@ 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(GameGlobals.current_match)
|
||||
file.store_var(GameGlobals.current_match_id)
|
||||
file.store_var(GameGlobals.current_round_id)
|
||||
file.store_var(money)
|
||||
file.store_var(deposited_money)
|
||||
file.store_var(health)
|
||||
@@ -95,7 +97,9 @@ 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()
|
||||
GameGlobals.current_match = file.get_var()
|
||||
GameGlobals.current_match_id = file.get_var()
|
||||
GameGlobals.current_round_id = 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()
|
||||
|
||||
@@ -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,10 +22,14 @@ func _process(delta: float) -> void:
|
||||
|
||||
|
||||
func _on_body_entered(body: Node3D) -> void:
|
||||
if active:
|
||||
GameGlobals.no_reentry_portals.append(round_id)
|
||||
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
|
||||
@@ -34,4 +40,4 @@ func _on_body_entered(body: Node3D) -> void:
|
||||
|
||||
|
||||
func _on_start_activation_timeout() -> void:
|
||||
active = true
|
||||
timer_active = true
|
||||
|
||||
Reference in New Issue
Block a user