rest of milestone 4
This commit is contained in:
parent
f958517574
commit
69faf54dc3
73 changed files with 3739 additions and 4560 deletions
|
|
@ -16,3 +16,12 @@ visible = false
|
|||
|
||||
[node name="Shaker" type="Node3D" parent="." unique_id=2089389922]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="ScoreLabel" type="Label3D" parent="." unique_id=1002653920]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.701858, 0)
|
||||
visible = false
|
||||
billboard = 1
|
||||
text = "+10"
|
||||
font_size = 164
|
||||
outline_size = 50
|
||||
|
|
|
|||
|
|
@ -4,11 +4,13 @@ extends CollisionObject3D
|
|||
@export var health := 10.
|
||||
|
||||
@export var shake_noise: FastNoiseLite
|
||||
@export var randomize_height := true
|
||||
var shake_duration := 0.
|
||||
@onready var initial_shaker_pos: Vector3 = %Shaker.position
|
||||
|
||||
func _ready() -> void:
|
||||
scale.y = randf_range(.5, 1.25)
|
||||
if randomize_height:
|
||||
scale.y = randf_range(.5, 1.25)
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
|
|
@ -21,6 +23,19 @@ func _process(delta: float) -> void:
|
|||
|
||||
shake_duration = move_toward(shake_duration, 0., delta)
|
||||
|
||||
func _show_score_label() -> void:
|
||||
%ScoreLabel.position.x += randf_range(-2, 2)
|
||||
%ScoreLabel.position.y += randf_range(-2, 2)
|
||||
%ScoreLabel.show()
|
||||
create_tween().tween_property(%ScoreLabel, "position:y", %ScoreLabel.position.y + 2., 1.)
|
||||
await get_tree().create_timer(.5, false).timeout
|
||||
|
||||
var t := create_tween()
|
||||
t.tween_property(%ScoreLabel, "modulate:a", 0., .5)
|
||||
t.parallel().tween_property(%ScoreLabel, "outline_modulate:a", 0., .5)
|
||||
t.finished.connect(%ScoreLabel.queue_free)
|
||||
|
||||
|
||||
func hit(_proj: Node3D, damage: float) -> bool:
|
||||
health -= damage
|
||||
if health <= 0.:
|
||||
|
|
@ -30,6 +45,9 @@ func hit(_proj: Node3D, damage: float) -> bool:
|
|||
%Shaker.hide()
|
||||
%DestroyedMesh.show()
|
||||
%GPUParticles3D.preprocess = randf()
|
||||
|
||||
_show_score_label()
|
||||
|
||||
else:
|
||||
shake_duration += 0.5
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,18 @@
|
|||
[gd_scene format=3 uid="uid://cm86dxphvhbb"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://yseykcc08n25" path="res://buildings/base_building.tscn" id="1_d2kbb"]
|
||||
[ext_resource type="PackedScene" uid="uid://dqy6nys24hpwv" path="res://models/buildings/building_A_withoutBase.gltf" id="2_re7gd"]
|
||||
[ext_resource type="PackedScene" uid="uid://cf8gco7x3iyk4" path="res://models/buildings/building_B_withoutBase.gltf" id="3_67vdi"]
|
||||
[ext_resource type="PackedScene" uid="uid://8777cm25nl6e" path="res://models/buildings/building_C_withoutBase.gltf" id="4_ixbkj"]
|
||||
[ext_resource type="PackedScene" uid="uid://xcog14b2bfp" path="res://models/buildings/building_D_withoutBase.gltf" id="5_ih3ya"]
|
||||
[ext_resource type="PackedScene" uid="uid://cvih7n5i3kekb" path="res://models/buildings/building_E_withoutBase.gltf" id="6_cdswn"]
|
||||
[ext_resource type="PackedScene" uid="uid://dqde1e0yr600m" path="res://models/buildings/building_F_withoutBase.gltf" id="7_63jeu"]
|
||||
[ext_resource type="PackedScene" uid="uid://dwom1rl84v1xy" path="res://models/buildings/building_G_withoutBase.gltf" id="8_ui6at"]
|
||||
[ext_resource type="PackedScene" uid="uid://bv11huboikukp" path="res://models/buildings/building_H_withoutBase.gltf" id="9_pdl3c"]
|
||||
[ext_resource type="Script" uid="uid://d1xiar6hicypm" path="res://buildings/building_behavior.gd" id="10_umrlk"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_5j34s"]
|
||||
size = Vector3(3, 5, 3)
|
||||
size = Vector3(4.989258, 5, 5.453125)
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_2yopf"]
|
||||
offsets = PackedFloat32Array(0.06315789, 0.6421053, 1)
|
||||
|
|
@ -41,16 +50,17 @@ material = SubResource("StandardMaterial3D_2vvqs")
|
|||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_5j34s"]
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_rqn35"]
|
||||
size = Vector3(3, 5, 3)
|
||||
|
||||
[node name="Building" unique_id=713127214 instance=ExtResource("1_d2kbb")]
|
||||
randomize_height = false
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="." index="0" unique_id=661727263]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, 0)
|
||||
shape = SubResource("BoxShape3D_5j34s")
|
||||
|
||||
[node name="GPUParticles3D" type="GPUParticles3D" parent="DestroyedMesh" parent_id_path=PackedInt32Array(1889390235) index="0" unique_id=349729190]
|
||||
[node name="DestroyedMesh" parent="." index="1" unique_id=1889390235]
|
||||
transform = Transform3D(1.5082386, 0, 0, 0, 1.5082386, 0, 0, 0, 1.5082386, 0, 0, 0)
|
||||
|
||||
[node name="GPUParticles3D" type="GPUParticles3D" parent="DestroyedMesh" index="0" unique_id=349729190]
|
||||
unique_name_in_owner = true
|
||||
amount = 1
|
||||
lifetime = 0.5
|
||||
|
|
@ -58,7 +68,7 @@ speed_scale = 0.5
|
|||
process_material = SubResource("ParticleProcessMaterial_ow2p3")
|
||||
draw_pass_1 = SubResource("SphereMesh_8evq1")
|
||||
|
||||
[node name="Cubez" type="Node3D" parent="DestroyedMesh" parent_id_path=PackedInt32Array(1889390235) index="1" unique_id=289648386]
|
||||
[node name="Cubez" type="Node3D" parent="DestroyedMesh" index="1" unique_id=289648386]
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="DestroyedMesh/Cubez" index="0" unique_id=1483935163]
|
||||
transform = Transform3D(-0.020582985, -0.013163342, -0.9997015, 0.53877074, -0.8424524, -2.0764832e-08, -0.84220093, -0.5386099, 0.02443221, 0, 0, 0)
|
||||
|
|
@ -112,7 +122,38 @@ mesh = SubResource("BoxMesh_5j34s")
|
|||
transform = Transform3D(-0.020582985, -0.013163342, -0.9997015, 0.53877074, -0.8424524, -2.0764832e-08, -0.84220093, -0.5386099, 0.02443221, -0.4571221, 0, -1.3370018)
|
||||
mesh = SubResource("BoxMesh_5j34s")
|
||||
|
||||
[node name="Mesh" type="MeshInstance3D" parent="Shaker" parent_id_path=PackedInt32Array(2089389922) index="0" unique_id=26690267]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, 0)
|
||||
mesh = SubResource("BoxMesh_rqn35")
|
||||
[node name="Shaker" parent="." index="2" unique_id=2089389922]
|
||||
transform = Transform3D(1.5082386, 0, 0, 0, 1.5082386, 0, 0, 0, 1.5082386, 0, 0, 0)
|
||||
|
||||
[node name="building_A_withoutBase2" parent="Shaker" index="0" unique_id=664786538 instance=ExtResource("2_re7gd")]
|
||||
transform = Transform3D(2.4153028, 0, 0, 0, 2.4153028, 0, 0, 0, 2.4153028, 0, 0, 0)
|
||||
|
||||
[node name="building_B_withoutBase2" parent="Shaker" index="1" unique_id=1490069154 instance=ExtResource("3_67vdi")]
|
||||
transform = Transform3D(1.8921158, 0, 0, 0, 1.8921158, 0, 0, 0, 1.8921158, 0, 0, 0)
|
||||
visible = false
|
||||
|
||||
[node name="building_C_withoutBase2" parent="Shaker" index="2" unique_id=1052756798 instance=ExtResource("4_ixbkj")]
|
||||
transform = Transform3D(2.304573, 0, 0, 0, 2.304573, 0, 0, 0, 2.304573, 0, 0, 0)
|
||||
visible = false
|
||||
|
||||
[node name="building_D_withoutBase2" parent="Shaker" index="3" unique_id=232808088 instance=ExtResource("5_ih3ya")]
|
||||
transform = Transform3D(1.8658643, 0, 0, 0, 1.8658643, 0, 0, 0, 1.8658643, 0, 0, 0)
|
||||
visible = false
|
||||
|
||||
[node name="building_E_withoutBase2" parent="Shaker" index="4" unique_id=609027628 instance=ExtResource("6_cdswn")]
|
||||
transform = Transform3D(1.5184681, 0, 0, 0, 1.5184681, 0, 0, 0, 1.5184681, 0, 0, 0)
|
||||
visible = false
|
||||
|
||||
[node name="building_F_withoutBase2" parent="Shaker" index="5" unique_id=839827008 instance=ExtResource("7_63jeu")]
|
||||
transform = Transform3D(1.5983136, 0, 0, 0, 1.5983136, 0, 0, 0, 1.5983136, 0, 0, 0)
|
||||
visible = false
|
||||
|
||||
[node name="building_G_withoutBase2" parent="Shaker" index="6" unique_id=6610699 instance=ExtResource("8_ui6at")]
|
||||
transform = Transform3D(1.5734245, 0, 0, 0, 1.5734245, 0, 0, 0, 1.5734245, 0, 0, 0)
|
||||
visible = false
|
||||
|
||||
[node name="building_H_withoutBase2" parent="Shaker" index="7" unique_id=425237666 instance=ExtResource("9_pdl3c")]
|
||||
transform = Transform3D(1.5437893, 0, 0, 0, 1.5437893, 0, 0, 0, 1.5437893, 0, 0, 0)
|
||||
|
||||
[node name="BuildingBehavior" type="Node" parent="." index="3" unique_id=1218785141]
|
||||
script = ExtResource("10_umrlk")
|
||||
|
|
|
|||
6
buildings/building_behavior.gd
Normal file
6
buildings/building_behavior.gd
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
extends Node
|
||||
|
||||
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
|
||||
1
buildings/building_behavior.gd.uid
Normal file
1
buildings/building_behavior.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://d1xiar6hicypm
|
||||
|
|
@ -38,8 +38,14 @@ material = SubResource("StandardMaterial3D_2vvqs")
|
|||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_hfj6b"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_i3lp1"]
|
||||
albedo_color = Color(0.47394764, 0.23997381, 3.3691526e-07, 1)
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_hn3k1"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_n0sh4"]
|
||||
albedo_color = Color(0.243375, 0.59, 0.1475, 1)
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_11lcc"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_hn3k1"]
|
||||
|
|
@ -114,26 +120,32 @@ transform = Transform3D(0.70885205, 0, 0, 0, 0.70885205, 0, 0, 0, 0.70885205, 0,
|
|||
|
||||
[node name="Stem" type="MeshInstance3D" parent="Shaker" index="0" unique_id=156669749]
|
||||
transform = Transform3D(0.70718205, -0.9436787, 0.92297167, 0.46422693, 3.5198092, -4.3827896e-08, -0.8511094, 1.1357385, 0.7668921, 0, 1.3363686, 0)
|
||||
material_override = SubResource("StandardMaterial3D_i3lp1")
|
||||
mesh = SubResource("BoxMesh_hn3k1")
|
||||
|
||||
[node name="Stem2" type="MeshInstance3D" parent="Shaker" index="1" unique_id=229856999]
|
||||
transform = Transform3D(0.43096656, -1.1965598, 0.6871064, -0.07412759, 3.6609116, 0.33437824, -0.72888476, -1.0798028, 0.37225807, -0.637649, 3.8433223, -0.3629342)
|
||||
material_override = SubResource("StandardMaterial3D_i3lp1")
|
||||
mesh = SubResource("BoxMesh_hn3k1")
|
||||
|
||||
[node name="Leaves" type="MeshInstance3D" parent="Shaker" index="2" unique_id=1530775788]
|
||||
transform = Transform3D(2.148287, 0.21797568, -1.0967563, 0.7066671, 1.5762988, 1.6974771, 0.86660796, -1.8257309, 1.3346244, -2.450163, 5.5032597, -1.1231996)
|
||||
material_override = SubResource("StandardMaterial3D_n0sh4")
|
||||
mesh = SubResource("BoxMesh_11lcc")
|
||||
|
||||
[node name="Leaves2" type="MeshInstance3D" parent="Shaker" index="3" unique_id=1147999215]
|
||||
transform = Transform3D(-1.8328239, -1.5762837, 0.1470051, -0.5105396, 0.8013866, 2.2277014, -1.4985428, 1.6548818, -0.93875486, -1.4362912, 5.5032597, 0.44623435)
|
||||
material_override = SubResource("StandardMaterial3D_n0sh4")
|
||||
mesh = SubResource("BoxMesh_11lcc")
|
||||
|
||||
[node name="Leaves3" type="MeshInstance3D" parent="Shaker" index="4" unique_id=1274378627]
|
||||
transform = Transform3D(1.0111561, -0.38601488, -2.1665826, -0.9885437, -2.209917, -0.06762316, -1.9661813, 0.91256994, -1.0802182, -0.24229479, 6.480358, -1.5169011)
|
||||
material_override = SubResource("StandardMaterial3D_n0sh4")
|
||||
mesh = SubResource("BoxMesh_11lcc")
|
||||
|
||||
[node name="Leaves4" type="MeshInstance3D" parent="Shaker" index="5" unique_id=1988467257]
|
||||
transform = Transform3D(1.8163599, 1.086452, -1.1772779, 1.159343, 0.3368203, 2.099524, 1.1055702, -2.138153, -0.26747093, -0.8257134, 6.480358, 0.4875511)
|
||||
material_override = SubResource("StandardMaterial3D_n0sh4")
|
||||
mesh = SubResource("BoxMesh_11lcc")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="." index="2" unique_id=370360243]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue