started building out hub more

This commit is contained in:
derek
2025-03-28 16:48:27 -05:00
parent a591865d4b
commit d64ef7ccde
20 changed files with 158 additions and 156 deletions

View File

@@ -36,6 +36,7 @@ func _ready():
level_name = self.get_name()
GameGlobals.current_level = str(self.scene_file_path)
if GameGlobals.loading_gamemode != null:
gamemode = GameGlobals.loading_gamemode
GameGlobals.loading_gamemode = null
@@ -103,8 +104,6 @@ func _ready():
func refresh_scene():
GameGlobals.health = gamemode.start_health
respawn_position = player.camera.global_position
respawn_cam_rotation = player.global_transform.basis
func gun_spawn(index):

View File

@@ -0,0 +1,20 @@
extends Node3D
class_name SkySwitcher
@export var skies : Array[Node] = []
var current_sky
func _ready() -> void:
for i in skies:
i.visible = false
func update_environment_sky(set_to_sky):
if set_to_sky != current_sky:
for i in skies:
if i != set_to_sky:
i.visible = false
skies[set_to_sky].visible = true

View File

@@ -0,0 +1 @@
uid://lvs6mktummv1

View File

@@ -15,7 +15,7 @@ func _ready() -> void:
portals.append(i)
if GameGlobals.playlist[0][GameGlobals.current_round_id].size() == 0:
if current_round.size() == 0:
var next_round = GameGlobals.current_round_id + 1
if next_round <= (GameGlobals.current_match.size() - 1):
GameGlobals.current_round_id = next_round

View File

@@ -8,6 +8,8 @@ var timer_active = false
var active = true
var index : int
const SCENE_SPAWN_OFFSET = Vector3(0,-150,0)
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
@@ -24,8 +26,11 @@ func _on_body_entered(body: Node3D) -> void:
active = false
var scene = load(level_info["level_path"]).instantiate()
if scene.sky_type != null:
SignalBus.emit_signal("update_sky",scene.sky_type)
get_tree().current_scene.add_child(scene)
scene.global_position = global_position
scene.global_position = global_position + SCENE_SPAWN_OFFSET
func _on_start_activation_timeout() -> void:

View File

@@ -15,3 +15,5 @@ signal enemy_hit()
signal enemy_killed()
signal king_killed()
signal weapon_list_changed()
## LEVEL

3
scripts/subscene.gd Normal file
View File

@@ -0,0 +1,3 @@
extends Node3D
@export_enum("Interior","Exterior") var sky_type = 1

1
scripts/subscene.gd.uid Normal file
View File

@@ -0,0 +1 @@
uid://b81yg4r8e5ecj

View File

@@ -264,7 +264,6 @@ func shotgun_pellet_spawn():
player.recoil.add_recoil(Vector3(0,weapon_info.recoil_amount.y,weapon_info.recoil_amount.z),10,10)
player.recoil.add_gun_recoil(weapon_info.recoil_amount.x)
player.velocity += player.bullet_ray.global_basis * Vector3(0,0, weapon_info.kick_amount)
SignalBus.emit_signal("shot_fired")
func spawn_muzzle_smoke():
var instance_smoke = weapon_info.muzzle_smoke.instantiate()
@@ -305,7 +304,6 @@ func bullet_fire():
player.recoil.add_recoil(Vector3(0,weapon_info.recoil_amount.y,weapon_info.recoil_amount.z),10,10)
player.recoil.add_gun_recoil(weapon_info.recoil_amount.x)
SignalBus.emit_signal("shot_fired")
func random_rotation(random_rotation):