diff --git a/buildings/building.scn b/buildings/building.scn index 9c22f1a..e35978f 100644 Binary files a/buildings/building.scn and b/buildings/building.scn differ diff --git a/buildings/building_behavior.gd b/buildings/building_behavior.gd index 71bd411..9aa6f74 100644 --- a/buildings/building_behavior.gd +++ b/buildings/building_behavior.gd @@ -1,12 +1,19 @@ extends Node @export var shatter_scenes: Array[PackedScene] +@export var building_meshes: Array[PackedScene] +@export var building_scales: PackedVector3Array + var shatter_scene: PackedScene func _ready() -> void: - var idx := randi_range(0, %Shaker.get_child_count() - 1) - for child in %Shaker.get_children(): - child.visible = child.get_index() == idx + var idx := randi_range(0, building_meshes.size() - 1) + # for child in %Shaker.get_children(): + # child.visible = child.get_index() == idx + + var building_mesh: Node3D = building_meshes[idx].instantiate() + building_mesh.scale = building_scales[idx] + %Shaker.add_child(building_mesh) shatter_scene = shatter_scenes[idx] func _on_building_destroyed_from(global_pos: Vector3) -> void: diff --git a/enemies/base_enemy.tscn b/enemies/base_enemy.tscn index 6de018a..847d5ed 100644 --- a/enemies/base_enemy.tscn +++ b/enemies/base_enemy.tscn @@ -24,8 +24,7 @@ collision_mask = 2 [node name="Siren" type="AudioStreamPlayer3D" parent="." unique_id=2085366724] unique_name_in_owner = true stream = ExtResource("2_bfj6p") -attenuation_model = 2 -unit_size = 12.0 +unit_size = 15.0 autoplay = true max_distance = 50.0 bus = &"Police Siren" diff --git a/loading_screen.gd b/loading_screen.gd new file mode 100644 index 0000000..e61fa8b --- /dev/null +++ b/loading_screen.gd @@ -0,0 +1,14 @@ +extends Control + +const SCENE_PATH := "res://levels/level_0.tscn" + +func _ready() -> void: + assert(ResourceLoader.load_threaded_request(SCENE_PATH, "", true) == OK) + # await get_tree().process_frame + # ResourceLoader.load_threaded_get("res://levels/level_0.tscn") + # get_tree().change_scene_to_file("res://ui/title_screen/title_screen.tscn") + +func _process(_delta: float) -> void: + if ResourceLoader.load_threaded_get_status(SCENE_PATH) == ResourceLoader.THREAD_LOAD_LOADED: + print("changing scene") + get_tree().change_scene_to_file("res://ui/title_screen/title_screen.tscn") diff --git a/loading_screen.gd.uid b/loading_screen.gd.uid new file mode 100644 index 0000000..e18ef18 --- /dev/null +++ b/loading_screen.gd.uid @@ -0,0 +1 @@ +uid://c0a6hljyyj5ry diff --git a/loading_screen.tscn b/loading_screen.tscn new file mode 100644 index 0000000..ee275e7 --- /dev/null +++ b/loading_screen.tscn @@ -0,0 +1,38 @@ +[gd_scene format=3 uid="uid://ct4qxncertpx6"] + +[ext_resource type="Script" uid="uid://c0a6hljyyj5ry" path="res://loading_screen.gd" id="1_mggpi"] + +[sub_resource type="FontVariation" id="FontVariation_n71f6"] +variation_transform = Transform2D(1.01, -0.32, 0.55, 1.045, 0, 1.83) +spacing_glyph = 13 + +[node name="LoadingScreen" type="Control" unique_id=1185076605] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_mggpi") + +[node name="ColorRect" type="ColorRect" parent="." unique_id=873491002] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(0, 0, 0, 1) + +[node name="Label" type="Label" parent="." unique_id=1034363801] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_fonts/font = SubResource("FontVariation_n71f6") +theme_override_font_sizes/font_size = 98 +text = "Loading" +horizontal_alignment = 1 +vertical_alignment = 1 diff --git a/player/player.tscn b/player/player.tscn index 8fb47cb..6e8e68c 100644 --- a/player/player.tscn +++ b/player/player.tscn @@ -338,7 +338,7 @@ bus = &"SFX" [node name="EngineSFX" type="AudioStreamPlayer" parent="." unique_id=668897298] unique_name_in_owner = true stream = ExtResource("15_wodsf") -volume_db = -6.0 +volume_db = -8.0 bus = &"SFX" [editable path="Tank"] diff --git a/project.godot b/project.godot index 0f7e71a..ea20929 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="Road Rage Tank" -run/main_scene="uid://c04ppsrjrkxb6" +run/main_scene="uid://ct4qxncertpx6" config/features=PackedStringArray("4.6") config/icon="res://icon.svg"