-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f41cba3
commit 6c9cb72
Showing
22 changed files
with
2,237 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
[gd_resource type="Resource" script_class="HandPoseSet" load_steps=6 format=3 uid="uid://bmmigv35h8cxa"] | ||
[gd_resource type="Resource" script_class="HandPoseSet" load_steps=7 format=3 uid="uid://bmmigv35h8cxa"] | ||
|
||
[ext_resource type="Script" path="res://addons/hand_pose_detector/hand_pose.gd" id="1_vg67v"] | ||
[ext_resource type="Resource" uid="uid://dhbqusuodrl3r" path="res://addons/hand_pose_detector/poses/fist.tres" id="2_c4yhd"] | ||
[ext_resource type="Resource" uid="uid://ceofxcl7q122" path="res://addons/hand_pose_detector/poses/point.tres" id="3_a70uy"] | ||
[ext_resource type="Script" path="res://addons/hand_pose_detector/hand_pose_set.gd" id="4_f1s8l"] | ||
[ext_resource type="Resource" uid="uid://8kyxp8p3nnv0" path="res://ar/hands/lightning.tres" id="4_ukem6"] | ||
[ext_resource type="Resource" uid="uid://sy66yqr1xila" path="res://addons/hand_pose_detector/poses/thumbs_up.tres" id="5_6jo51"] | ||
|
||
[resource] | ||
script = ExtResource("4_f1s8l") | ||
poses = Array[ExtResource("1_vg67v")]([ExtResource("2_c4yhd"), ExtResource("3_a70uy"), ExtResource("4_ukem6")]) | ||
poses = Array[ExtResource("1_vg67v")]([ExtResource("2_c4yhd"), ExtResource("3_a70uy"), ExtResource("4_ukem6"), ExtResource("5_6jo51")]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
extends StaticBody3D | ||
|
||
|
||
var _grown : bool = false | ||
|
||
|
||
# Called when the node enters the scene tree for the first time. | ||
func _ready() -> void: | ||
# Set the plant scale to zero and disable collision | ||
%Object.scale = Vector3.ZERO | ||
%Collision.disabled = true | ||
|
||
# Tween scaling the plant to full size | ||
var tween = get_tree().create_tween() | ||
tween.tween_property(%Object, "scale", Vector3.ONE, 1.0) | ||
tween.tween_callback(_on_grown) | ||
|
||
|
||
# Called when fully grown | ||
func _on_grown() -> void: | ||
# Enable collision | ||
%Collision.disabled = false | ||
_grown = true | ||
|
||
|
||
func damage() -> void: | ||
# Cannot damage if not grown | ||
if not _grown: | ||
return | ||
|
||
# Disable collision | ||
%Collision.disabled = true | ||
_grown = false | ||
|
||
# Shrink and destroy | ||
var tween = get_tree().create_tween() | ||
tween.tween_property(%Object, "scale", Vector3.ZERO, 1.0) | ||
tween.tween_callback(queue_free) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[gd_scene load_steps=4 format=3 uid="uid://cuqkxcsnjduau"] | ||
|
||
[ext_resource type="Script" path="res://ar/objects/destructible.gd" id="1_bredg"] | ||
[ext_resource type="PackedScene" uid="uid://bqkrg317dd7bb" path="res://assets/meshes/moss_flower.tscn" id="2_35brj"] | ||
|
||
[sub_resource type="SphereShape3D" id="SphereShape3D_vgnh5"] | ||
radius = 0.181445 | ||
|
||
[node name="MossFlower" type="StaticBody3D" groups=["destructible"]] | ||
collision_layer = 2 | ||
collision_mask = 0 | ||
script = ExtResource("1_bredg") | ||
|
||
[node name="Collision" type="CollisionShape3D" parent="."] | ||
unique_name_in_owner = true | ||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.110201, 0) | ||
shape = SubResource("SphereShape3D_vgnh5") | ||
|
||
[node name="Object" parent="." instance=ExtResource("2_35brj")] | ||
unique_name_in_owner = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[gd_scene load_steps=4 format=3 uid="uid://c8drr7w7g0jdf"] | ||
|
||
[ext_resource type="PackedScene" uid="uid://y0o3ldi4wol1" path="res://assets/meshes/yard_grass.tscn" id="1_v60ox"] | ||
[ext_resource type="Script" path="res://ar/objects/destructible.gd" id="1_vvql1"] | ||
|
||
[sub_resource type="SphereShape3D" id="SphereShape3D_w5r4d"] | ||
radius = 0.279486 | ||
|
||
[node name="YardGrass" type="StaticBody3D" groups=["destructible"]] | ||
collision_layer = 2 | ||
collision_mask = 0 | ||
script = ExtResource("1_vvql1") | ||
|
||
[node name="Collision" type="CollisionShape3D" parent="."] | ||
unique_name_in_owner = true | ||
shape = SubResource("SphereShape3D_w5r4d") | ||
|
||
[node name="Object" parent="." instance=ExtResource("1_v60ox")] | ||
unique_name_in_owner = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,46 @@ | ||
extends Node3D | ||
extends AnimatableBody3D | ||
|
||
|
||
func _ready() -> void: | ||
%GPUParticles3D.emitting = true | ||
const VELOCITY := 6.0 | ||
|
||
const DAMAGE_RANGE := 0.8 | ||
|
||
func _on_timer_timeout() -> void: | ||
queue_free() | ||
|
||
var _hit : bool = false | ||
var _expire : float = 3.0 | ||
|
||
|
||
# Called every frame. 'delta' is the elapsed time since the previous frame. | ||
func _process(delta: float) -> void: | ||
# Update expiration timer | ||
_expire -= delta | ||
|
||
# Process if not hit | ||
if not _hit: | ||
# Move the fireball and update expiration time | ||
var collision := move_and_collide(-global_basis.z * VELOCITY * delta) | ||
|
||
# Handle collision or flight-expiration | ||
if collision or _expire <= 0.0: | ||
# Trigger explosion | ||
_explode() | ||
_hit = true | ||
_expire = 2.0 | ||
|
||
# Free if expired | ||
if _hit and _expire <= 0.0: | ||
queue_free() | ||
|
||
|
||
func _explode() -> void: | ||
# Perform explision | ||
%TrailParticles.emitting = false | ||
|
||
var kill_list := get_tree().get_nodes_in_group("destructible") | ||
for k in kill_list: | ||
if global_position.distance_to(k.global_position) < DAMAGE_RANGE: | ||
k.damage() | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,57 @@ | ||
[gd_scene load_steps=9 format=3 uid="uid://blv7ye5k0f3ox"] | ||
[gd_scene load_steps=10 format=3 uid="uid://b1yt3m0qesmx8"] | ||
|
||
[ext_resource type="Script" path="res://ar/spells/lightning.gd" id="1_6klr6"] | ||
[ext_resource type="Texture2D" uid="uid://cc750lgosa8v2" path="res://addons/kenney_particle_pack/spark_03.png" id="1_lbhv0"] | ||
[ext_resource type="Texture2D" uid="uid://cykuuu3rfqm7d" path="res://addons/kenney_particle_pack/spark_01.png" id="2_nxcjo"] | ||
[ext_resource type="AudioStream" uid="uid://bx6nrnl7vl0xc" path="res://assets/sounds/sparks.wav" id="3_os4q2"] | ||
|
||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_luvq8"] | ||
[sub_resource type="SphereShape3D" id="SphereShape3D_xuhcn"] | ||
radius = 0.05 | ||
|
||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_q40ya"] | ||
transparency = 1 | ||
blend_mode = 1 | ||
cull_mode = 2 | ||
vertex_color_use_as_albedo = true | ||
albedo_texture = ExtResource("1_lbhv0") | ||
albedo_texture = ExtResource("2_nxcjo") | ||
disable_receive_shadows = true | ||
billboard_mode = 3 | ||
billboard_keep_scale = true | ||
particles_anim_h_frames = 1 | ||
particles_anim_v_frames = 1 | ||
particles_anim_loop = false | ||
|
||
[sub_resource type="Curve" id="Curve_fcwys"] | ||
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.0395738, 0), 0.0, 0.0, 0, 0, Vector2(0.0898021, 1), 0.0, 0.0, 0, 0, Vector2(0.146119, 0), 0.0, 0.0, 0, 0, Vector2(0.216134, 0), 0.0, 0.0, 0, 0, Vector2(0.254186, 0.717391), 0.0, 0.0, 0, 0, Vector2(0.29376, 0), 0.0, 0.0, 0, 0, Vector2(0.400304, 0), 0.0, 0.0, 0, 0, Vector2(0.439878, 0.542102), 0.0, 0.0, 0, 0, Vector2(0.487062, 0), 0.0, 0.0, 0, 0, Vector2(0.563166, 0), 0.0, 0.0, 0, 0, Vector2(0.61035, 0.341772), 0.0, 0.0, 0, 0, Vector2(0.668189, 0), 0.0, 0.0, 0, 0, Vector2(0.729072, 0), 0.0, 0.0, 0, 0, Vector2(0.761035, 0.255916), 0.0, 0.0, 0, 0, Vector2(0.802131, 0), 0.0, 0.0, 0, 0, Vector2(0.858447, 0), 0.0, 0.0, 0, 0, Vector2(0.887984, 0.12282), 0.0, 0.0, 0, 0, Vector2(0.916286, 0), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] | ||
point_count = 20 | ||
|
||
[sub_resource type="CurveTexture" id="CurveTexture_5vcqc"] | ||
curve = SubResource("Curve_fcwys") | ||
|
||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_uuexw"] | ||
angle_min = -180.0 | ||
angle_max = 180.0 | ||
direction = Vector3(0, 0, -1) | ||
spread = 20.0 | ||
flatness = 1.0 | ||
initial_velocity_min = 3.0 | ||
initial_velocity_max = 6.0 | ||
[sub_resource type="Curve" id="Curve_r6cpr"] | ||
_data = [Vector2(0.0103093, 0), 0.0, 0.0, 0, 0, Vector2(0.0234483, 1), 0.0, 0.0, 0, 0, Vector2(0.0496552, 0), 0.0, 0.0, 0, 0, Vector2(0.13931, 0), 0.0, 0.0, 0, 0, Vector2(0.154483, 0.881), 0.0, 0.0, 0, 0, Vector2(0.175258, 0), 0.0, 0.0, 0, 0, Vector2(0.266207, 0), 0.0, 0.0, 0, 0, Vector2(0.281379, 0.710539), 0.0, 0.0, 0, 0, Vector2(0.298969, 0), 0.0, 0.0, 0, 0, Vector2(0.390345, 0), 0.0, 0.0, 0, 0, Vector2(0.404138, 0.559377), 0.0, 0.0, 0, 0, Vector2(0.42268, 0), 0.0, 0.0, 0, 0, Vector2(0.508965, 0), 0.0, 0.0, 0, 0, Vector2(0.531034, 0.231321), 0.0, 0.0, 0, 0, Vector2(0.54433, 0), 0.0, 0.0, 0, 0, Vector2(0.642759, 0), 0.0, 0.0, 0, 0, Vector2(0.652414, 0.147699), 0.0, 0.0, 0, 0, Vector2(0.670345, 0), 0.0, 0.0, 0, 0, Vector2(0.776552, 0), 0.0, 0.0, 0, 0, Vector2(0.786207, 0.105888), 0.0, 0.0, 0, 0, Vector2(0.795862, 0), 0.0, 0.0, 0, 0, Vector2(0.921379, 0), 0.0, 0.0, 0, 0, Vector2(0.929655, 0.0640773), 0.0, 0.0, 0, 0, Vector2(0.942069, 0), 0.0, 0.0, 0, 0] | ||
point_count = 24 | ||
|
||
[sub_resource type="CurveTexture" id="CurveTexture_3g6n4"] | ||
curve = SubResource("Curve_r6cpr") | ||
|
||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_sagkm"] | ||
emission_shape = 1 | ||
emission_sphere_radius = 0.05 | ||
angle_min = 1.07288e-05 | ||
angle_max = 360.0 | ||
spread = 180.0 | ||
initial_velocity_max = 0.2 | ||
gravity = Vector3(0, 0, 0) | ||
color = Color(3, 5, 5, 1) | ||
alpha_curve = SubResource("CurveTexture_5vcqc") | ||
color = Color(2, 2, 4, 1) | ||
alpha_curve = SubResource("CurveTexture_3g6n4") | ||
|
||
[sub_resource type="QuadMesh" id="QuadMesh_h5g5p"] | ||
[sub_resource type="QuadMesh" id="QuadMesh_oog7i"] | ||
size = Vector2(0.3, 0.3) | ||
|
||
[node name="Lightning" type="Node3D"] | ||
[node name="Lightning2" type="AnimatableBody3D"] | ||
script = ExtResource("1_6klr6") | ||
|
||
[node name="GPUParticles3D" type="GPUParticles3D" parent="."] | ||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."] | ||
shape = SubResource("SphereShape3D_xuhcn") | ||
|
||
[node name="TrailParticles" type="GPUParticles3D" parent="."] | ||
unique_name_in_owner = true | ||
material_override = SubResource("StandardMaterial3D_luvq8") | ||
emitting = false | ||
amount = 50 | ||
one_shot = true | ||
explosiveness = 0.45 | ||
process_material = SubResource("ParticleProcessMaterial_uuexw") | ||
draw_pass_1 = SubResource("QuadMesh_h5g5p") | ||
|
||
[node name="Timer" type="Timer" parent="."] | ||
wait_time = 2.0 | ||
one_shot = true | ||
|
||
[node name="Sparks" type="AudioStreamPlayer3D" parent="."] | ||
material_override = SubResource("StandardMaterial3D_q40ya") | ||
amount = 100 | ||
process_material = SubResource("ParticleProcessMaterial_sagkm") | ||
draw_pass_1 = SubResource("QuadMesh_oog7i") | ||
|
||
[node name="Sound" type="AudioStreamPlayer3D" parent="."] | ||
stream = ExtResource("3_os4q2") | ||
autoplay = true | ||
|
||
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"] |
Oops, something went wrong.