From a16ea0cd152d6f7d6ae7c2c567c51869357b926f Mon Sep 17 00:00:00 2001 From: ncusimano Date: Sun, 20 Aug 2023 15:43:03 -0600 Subject: [PATCH 1/5] Slimes Turn When Stuck :) --- godot/Level/Island.tscn | 4 ++-- godot/Models/grape_man.tscn | 12 +++--------- godot/player.tscn | 8 ++------ godot/slime_shared.gd | 20 ++++++++++++++++++++ godot/slime_shared.tscn | 2 ++ 5 files changed, 29 insertions(+), 17 deletions(-) diff --git a/godot/Level/Island.tscn b/godot/Level/Island.tscn index 053cf95..0d1d8fb 100644 --- a/godot/Level/Island.tscn +++ b/godot/Level/Island.tscn @@ -23,9 +23,9 @@ [ext_resource type="PackedScene" uid="uid://b3aus2kigf8xt" path="res://Models/beach_decor/cooler.tscn" id="24_sl7ne"] [ext_resource type="PackedScene" uid="uid://cft26nug7kyqb" path="res://ambient_light_1.tscn" id="25_novxt"] [ext_resource type="PackedScene" path="res://color_cube.tscn" id="25_rm0cr"] -[ext_resource type="PackedScene" uid="uid://d2pvg0f5jtpve" path="res://slime_kill_box.tscn" id="27_cjxk6"] +[ext_resource type="PackedScene" path="res://slime_kill_box.tscn" id="27_cjxk6"] [ext_resource type="PackedScene" uid="uid://bw3k2c75qavce" path="res://Models/beach_decor/bucket.tscn" id="27_f3p1i"] -[ext_resource type="PackedScene" uid="uid://6ycop5t3nra5" path="res://Level/World/DayNightEnvironment.tscn" id="27_jutn4"] +[ext_resource type="PackedScene" path="res://Level/World/DayNightEnvironment.tscn" id="27_jutn4"] [ext_resource type="PackedScene" uid="uid://g4gmc0pwlak1" path="res://Models/buildings/fence.tscn" id="28_prydb"] [sub_resource type="Animation" id="Animation_jpnyu"] diff --git a/godot/Models/grape_man.tscn b/godot/Models/grape_man.tscn index 759ad10..bee880f 100644 --- a/godot/Models/grape_man.tscn +++ b/godot/Models/grape_man.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=42 format=3 uid="uid://bgoo1lbt28na"] +[gd_scene load_steps=41 format=3 uid="uid://bgoo1lbt28na"] [ext_resource type="PackedScene" uid="uid://bhanbx2dyhv2d" path="res://Models/grape_man.glb" id="1_fh5yr"] [ext_resource type="Script" path="res://Models/grape_man.gd" id="2_ksje8"] @@ -6,7 +6,6 @@ [ext_resource type="AudioStream" uid="uid://baocyd0p3jcku" path="res://Sounds/pickup_grunt.ogg" id="4_nvurj"] [ext_resource type="AudioStream" uid="uid://b80t5xqckjoqk" path="res://Sounds/heartychuckle.ogg" id="5_b32re"] [ext_resource type="AudioStream" uid="uid://0mhkf1ls1wcn" path="res://Sounds/sadsound.ogg" id="6_qe4bi"] -[ext_resource type="AudioStream" uid="uid://bmocmgq06o6f5" path="res://Sounds/footstep.ogg" id="7_b2ik0"] [sub_resource type="AnimationNodeAdd2" id="AnimationNodeAdd2_a0vxm"] filters = ["rig/Skeleton3D:forearm.L", "rig/Skeleton3D:forearm.R", "rig/Skeleton3D:head", "rig/Skeleton3D:upper_arm.L", "rig/Skeleton3D:upper_arm.R"] @@ -155,7 +154,7 @@ transform = Transform3D(0.065, 0, 0, 0, 0.065, 0, 0, 0, 0.065, 0, 0, 0) script = ExtResource("2_ksje8") [node name="Skeleton3D" parent="rig" index="0"] -bones/0/rotation = Quaternion(0.0733902, 0, 0, 0.997303) +bones/0/rotation = Quaternion(0.0664168, 0, 0, 0.997792) bones/1/rotation = Quaternion(-0.0891896, 1.18734e-07, -1.06322e-08, 0.996015) bones/2/rotation = Quaternion(0.0133933, -1.19199e-07, 1.5966e-09, 0.99991) bones/3/rotation = Quaternion(-0.00997737, 0.100365, -0.694951, 0.711948) @@ -170,7 +169,6 @@ bones/15/rotation = Quaternion(0.105246, -0.0039338, 0.0113526, 0.994374) [node name="OmniLight3D" type="OmniLight3D" parent="." index="2"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.289473, 8.26292, 4.26359) -light_energy = 0.5 [node name="AnimationTree" type="AnimationTree" parent="." index="3"] tree_root = SubResource("AnimationNodeStateMachine_6mfdu") @@ -193,9 +191,5 @@ stream = ExtResource("5_b32re") [node name="sad" type="AudioStreamPlayer" parent="." index="7"] stream = ExtResource("6_qe4bi") -[node name="soundboard" type="AudioStreamPlayer" parent="." index="8"] +[node name="woohoo" type="AudioStreamPlayer" parent="." index="8"] stream = ExtResource("6_qe4bi") - -[node name="footstep" type="AudioStreamPlayer" parent="." index="9"] -stream = ExtResource("7_b2ik0") -volume_db = -10.0 diff --git a/godot/player.tscn b/godot/player.tscn index 576fad1..4b969c4 100644 --- a/godot/player.tscn +++ b/godot/player.tscn @@ -1,9 +1,8 @@ -[gd_scene load_steps=7 format=3 uid="uid://7utef1nnena8"] +[gd_scene load_steps=6 format=3 uid="uid://7utef1nnena8"] [ext_resource type="Script" path="res://Player.gd" id="1_7gpdp"] [ext_resource type="PackedScene" uid="uid://bgoo1lbt28na" path="res://Models/grape_man.tscn" id="2_ctyy5"] [ext_resource type="Script" path="res://Holster.gd" id="3_a68da"] -[ext_resource type="PackedScene" uid="uid://cbca7q18ae42h" path="res://UI/PauseMenu.tscn" id="4_kcqpl"] [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_kb4ms"] radius = 0.0669067 @@ -25,7 +24,7 @@ shape = SubResource("CapsuleShape3D_kb4ms") transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.389874, 0) [node name="PlayerCam" type="Camera3D" parent="CameraMount"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.930216) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.643936) current = true fov = 50.0 @@ -38,9 +37,6 @@ script = ExtResource("3_a68da") transform = Transform3D(0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0, 0.0672282, 0) shape = SubResource("SphereShape3D_6l1w6") -[node name="PauseMenu" parent="." instance=ExtResource("4_kcqpl")] -visible = false - [connection signal="anim_check_grab" from="grape_man" to="." method="_on_grape_man_anim_check_grab"] [connection signal="body_entered" from="Holster/Area3D" to="." method="_on_holster_enter"] [connection signal="body_exited" from="Holster/Area3D" to="." method="_on_holster_exit"] diff --git a/godot/slime_shared.gd b/godot/slime_shared.gd index 0465a66..ebed2f2 100644 --- a/godot/slime_shared.gd +++ b/godot/slime_shared.gd @@ -22,11 +22,18 @@ var task = "idle" # Margin of accuracy to which the character will correct their direction when off course (radians). @export var dir_accuracy = deg_to_rad(0.1) +var wall_timer + # Get the gravity from the project settings to be synced with RigidBody nodes. var gravity = ProjectSettings.get_setting("physics/3d/default_gravity") func _ready(): $slime.idle() + wall_timer = Timer.new() + wall_timer.wait_time = 5 + wall_timer.one_shot = true + wall_timer.timeout.connect(_on_timer_timeout) + add_child(wall_timer) func walk(): $slime.walk() @@ -43,6 +50,9 @@ func walk(): target_location_xz = location_xz task = "idle" + if !wall_timer.is_stopped(): + wall_timer.stop() + func spin(): # Continue to correct direction to within a margin of dir_accuracy degrees. if direction_xz.angle_to(target_direction_xz) >= dir_accuracy: @@ -59,6 +69,7 @@ func idle(): if task <= walk_chance: task = "walk" target_location_xz = transform.origin * Vector3(1, 0, 1) + (direction_xz * 4) + wall_timer.start() # 6% chance to rotate. elif task > walk_chance and task <= (walk_chance + spin_chance): task = "spin" @@ -68,6 +79,15 @@ func idle(): # 90% chance to idle. elif task > (spin_chance + walk_chance): task = "idle" + +# Stops walking if cannot reach destination in 5 sec. +func _on_timer_timeout(): + # Try to turn around before walking again. + if task == "walk": + task = "spin" + var rotation_angle = rng.randf_range(-2*PI, 2*PI) + var rotation_vector = Vector3(cos(rotation_angle), 0, sin(rotation_angle)) + target_direction_xz = direction_xz + rotation_vector # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(_delta): diff --git a/godot/slime_shared.tscn b/godot/slime_shared.tscn index 1c473d5..075b92a 100644 --- a/godot/slime_shared.tscn +++ b/godot/slime_shared.tscn @@ -15,3 +15,5 @@ transform = Transform3D(0.035, 0, 0, 0, 0.035, 0, 0, 0, 0.035, 0, 0, 0) [node name="slime_collision" type="CollisionShape3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0408143, 0) shape = SubResource("SphereShape3D_k5rhc") + +[node name="IsTrappedOnWall" type="Timer" parent="."] From f972ee5974743c2faba6e130ef7f63e363ab61ae Mon Sep 17 00:00:00 2001 From: Spencer Killen Date: Sun, 20 Aug 2023 16:23:50 -0600 Subject: [PATCH 2/5] beach ball --- godot/Crate.gd | 4 + godot/Level/Island.tscn | 13 +- godot/Models/ball.obj | 609 +++++++++++++++++++++++++++++++++ godot/Models/ball.obj.import | 21 ++ godot/Player.gd | 11 + godot/Textures/ball.png | 3 + godot/Textures/ball.png.import | 35 ++ godot/crate.tscn | 24 ++ textures/ball.png | Bin 0 -> 2801 bytes 9 files changed, 719 insertions(+), 1 deletion(-) create mode 100644 godot/Crate.gd create mode 100644 godot/Models/ball.obj create mode 100644 godot/Models/ball.obj.import create mode 100644 godot/Textures/ball.png create mode 100644 godot/Textures/ball.png.import create mode 100644 godot/crate.tscn create mode 100644 textures/ball.png diff --git a/godot/Crate.gd b/godot/Crate.gd new file mode 100644 index 0000000..2ec583b --- /dev/null +++ b/godot/Crate.gd @@ -0,0 +1,4 @@ +extends RigidBody3D + +var is_holdable = true +var is_pushable = true diff --git a/godot/Level/Island.tscn b/godot/Level/Island.tscn index 71fc52d..a09b494 100644 --- a/godot/Level/Island.tscn +++ b/godot/Level/Island.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=32 format=3 uid="uid://3d51hjh2st8a"] +[gd_scene load_steps=33 format=3 uid="uid://3d51hjh2st8a"] [ext_resource type="PackedScene" uid="uid://d2d4uv7o5gx5p" path="res://Level/World/screen_shader.tscn" id="1_huyen"] [ext_resource type="PackedScene" uid="uid://d3ccrfjpg4hbv" path="res://Models/palm_curved.tscn" id="3_bth2b"] @@ -27,6 +27,7 @@ [ext_resource type="PackedScene" uid="uid://bw3k2c75qavce" path="res://Models/beach_decor/bucket.tscn" id="27_f3p1i"] [ext_resource type="PackedScene" uid="uid://6ycop5t3nra5" path="res://Level/World/DayNightEnvironment.tscn" id="27_jutn4"] [ext_resource type="PackedScene" uid="uid://g4gmc0pwlak1" path="res://Models/buildings/fence.tscn" id="28_prydb"] +[ext_resource type="PackedScene" uid="uid://ckbba1bs71tl" path="res://crate.tscn" id="28_x0lrj"] [sub_resource type="Animation" id="Animation_jpnyu"] resource_name = "waves" @@ -481,6 +482,16 @@ shape = SubResource("BoxShape3D_um2bu") [node name="SlimeKillBox" parent="." instance=ExtResource("27_cjxk6")] +[node name="Crate" parent="." instance=ExtResource("28_x0lrj")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 2.44712, -1) +mass = 0.01 + +[node name="Crate3" parent="." instance=ExtResource("28_x0lrj")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.75088, 2.39766, -4.28161) + +[node name="Crate4" parent="." instance=ExtResource("28_x0lrj")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.31447, 2.55588, -2.13044) + [connection signal="finished" from="Music" to="Music" method="_on_finished"] [connection signal="timeout" from="Music/Transition" to="Music" method="_on_transition_timer_timeout"] [connection signal="timeout" from="Music/Tween" to="Music" method="_on_tween_timer_timeout"] diff --git a/godot/Models/ball.obj b/godot/Models/ball.obj new file mode 100644 index 0000000..20026cd --- /dev/null +++ b/godot/Models/ball.obj @@ -0,0 +1,609 @@ +# Blender v2.90.0 OBJ File: '' +# www.blender.org +mtllib ball.mtl +o ball +v 0.076537 0.000000 -0.184776 +v 0.000000 0.076537 -0.184776 +v 0.070711 0.076537 -0.170711 +v 0.000000 0.200000 0.000000 +v 0.029289 0.184776 -0.070711 +v 0.000000 0.184776 -0.076537 +v 0.000000 0.141421 -0.141421 +v -0.070711 0.076537 -0.170711 +v -0.054120 0.141421 -0.130656 +v 0.130656 -0.076537 -0.130656 +v 0.141421 0.000000 -0.141421 +v 0.054120 0.184776 -0.054120 +v 0.054120 0.141421 -0.130656 +v 0.029289 -0.184776 -0.070711 +v 0.000000 -0.200000 -0.000000 +v 0.000000 -0.184776 -0.076537 +v 0.000000 -0.141421 -0.141421 +v 0.054120 -0.141421 -0.130656 +v 0.170711 -0.076537 -0.070711 +v 0.184776 0.000000 -0.076537 +v 0.100000 -0.141421 -0.100000 +v 0.070711 -0.076537 -0.170711 +v 0.130656 0.076537 -0.130656 +v 0.100000 0.141421 -0.100000 +v 0.054120 -0.184776 -0.054120 +v 0.130656 0.141421 -0.054120 +v 0.070711 0.184776 -0.029289 +v 0.184776 0.076537 0.000000 +v 0.141421 0.141421 0.000000 +v 0.170711 0.076537 -0.070711 +v 0.070711 -0.184776 -0.029289 +v 0.130656 -0.141421 -0.054120 +v 0.184776 -0.076537 -0.000000 +v 0.200000 0.000000 0.000000 +v 0.070711 -0.184776 0.029289 +v 0.141421 -0.141421 -0.000000 +v 0.130656 -0.141421 0.054120 +v 0.076537 -0.184776 -0.000000 +v 0.076537 0.184776 0.000000 +v 0.170711 -0.076537 0.070711 +v 0.184776 -0.000000 0.076537 +v 0.100000 -0.141421 0.100000 +v 0.170711 0.076537 0.070711 +v 0.130656 0.141421 0.054120 +v 0.070711 0.184776 0.029289 +v 0.130656 -0.076537 0.130656 +v 0.141421 -0.000000 0.141421 +v 0.130656 0.076537 0.130656 +v 0.100000 0.141421 0.100000 +v 0.076537 -0.000000 0.184776 +v 0.070711 0.076537 0.170711 +v 0.054120 -0.184776 0.054120 +v 0.054120 0.184776 0.054120 +v 0.070711 -0.076537 0.170711 +v 0.029289 -0.184776 0.070711 +v 0.054120 -0.141421 0.130656 +v 0.000000 -0.184776 0.076537 +v 0.029289 0.184776 0.070711 +v 0.054120 0.141421 0.130656 +v 0.000000 -0.076537 0.184776 +v 0.000000 -0.000000 0.200000 +v 0.000000 -0.141421 0.141421 +v -0.070711 0.076537 0.170711 +v 0.000000 0.076537 0.184776 +v 0.000000 0.184776 0.076537 +v -0.029289 -0.184776 0.070711 +v 0.000000 0.141421 0.141421 +v -0.054120 -0.141421 0.130656 +v -0.054120 -0.184776 0.054120 +v -0.029289 0.184776 0.070711 +v -0.070711 -0.076537 0.170711 +v -0.076537 -0.000000 0.184776 +v -0.070711 0.184776 -0.029289 +v -0.141421 0.141421 0.000000 +v -0.076537 0.184776 0.000000 +v -0.054120 0.141421 0.130656 +v -0.130656 0.076537 0.130656 +v -0.070711 0.184776 0.029289 +v -0.054120 0.184776 0.054120 +v -0.130656 -0.076537 0.130656 +v -0.141421 -0.000000 0.141421 +v -0.170711 -0.076537 0.070711 +v -0.184776 -0.000000 0.076537 +v -0.100000 0.141421 0.100000 +v -0.100000 -0.141421 0.100000 +v -0.070711 -0.184776 0.029289 +v -0.184776 -0.076537 -0.000000 +v -0.200000 0.000000 0.000000 +v 0.000000 0.000000 -0.200000 +v -0.170711 0.076537 0.070711 +v -0.130656 0.141421 0.054120 +v -0.130656 -0.141421 0.054120 +v -0.076537 -0.184776 -0.000000 +v -0.170711 -0.076537 -0.070711 +v -0.184776 0.000000 -0.076537 +v -0.184776 0.076537 0.000000 +v -0.141421 -0.141421 -0.000000 +v -0.130656 -0.076537 -0.130656 +v -0.141421 0.000000 -0.141421 +v -0.130656 -0.141421 -0.054120 +v -0.170711 0.076537 -0.070711 +v -0.130656 0.141421 -0.054120 +v -0.070711 -0.184776 -0.029289 +v -0.070711 -0.076537 -0.170711 +v -0.076537 0.000000 -0.184776 +v -0.100000 -0.141421 -0.100000 +v -0.130656 0.076537 -0.130656 +v -0.100000 0.141421 -0.100000 +v -0.054120 0.184776 -0.054120 +v -0.054120 -0.184776 -0.054120 +v 0.000000 -0.076537 -0.184776 +v -0.029289 0.184776 -0.070711 +v -0.029289 -0.184776 -0.070711 +v -0.054120 -0.141421 -0.130656 +vt 0.687500 0.500000 +vt 0.750000 0.625000 +vt 0.687500 0.625000 +vt 0.703125 1.000000 +vt 0.687500 0.875000 +vt 0.750000 0.875000 +vt 0.750000 0.750000 +vt 0.812500 0.625000 +vt 0.812500 0.750000 +vt 0.625000 0.375000 +vt 0.625000 0.500000 +vt 0.625000 0.875000 +vt 0.687500 0.750000 +vt 0.687500 0.125000 +vt 0.734375 0.000000 +vt 0.750000 0.125000 +vt 0.750000 0.250000 +vt 0.687500 0.250000 +vt 0.562500 0.375000 +vt 0.562500 0.500000 +vt 0.625000 0.250000 +vt 0.687500 0.375000 +vt 0.625000 0.625000 +vt 0.625000 0.750000 +vt 0.625000 0.125000 +vt 0.671875 0.000000 +vt 0.640625 1.000000 +vt 0.562500 0.750000 +vt 0.562500 0.875000 +vt 0.500000 0.625000 +vt 0.500000 0.750000 +vt 0.562500 0.625000 +vt 0.562500 0.125000 +vt 0.562500 0.250000 +vt 0.609375 0.000000 +vt 0.578125 1.000000 +vt 0.500000 0.375000 +vt 0.500000 0.500000 +vt 0.437500 0.125000 +vt 0.500000 0.250000 +vt 0.437500 0.250000 +vt 0.500000 0.125000 +vt 0.546875 0.000000 +vt 0.515625 1.000000 +vt 0.500000 0.875000 +vt 0.437500 0.375000 +vt 0.437500 0.500000 +vt 0.375000 0.250000 +vt 0.437500 0.625000 +vt 0.437500 0.750000 +vt 0.484375 0.000000 +vt 0.453124 1.000000 +vt 0.437500 0.875000 +vt 0.375000 0.375000 +vt 0.375000 0.500000 +vt 0.375000 0.625000 +vt 0.375000 0.750000 +vt 0.312500 0.500000 +vt 0.312500 0.625000 +vt 0.375000 0.125000 +vt 0.421875 0.000000 +vt 0.390625 1.000000 +vt 0.375000 0.875000 +vt 0.312500 0.375000 +vt 0.312500 0.125000 +vt 0.312500 0.250000 +vt 0.250000 0.125000 +vt 0.296875 0.000000 +vt 0.359375 0.000000 +vt 0.328125 1.000000 +vt 0.312500 0.875000 +vt 0.312500 0.750000 +vt 0.250000 0.375000 +vt 0.250000 0.500000 +vt 0.250000 0.250000 +vt 0.187500 0.625000 +vt 0.250000 0.625000 +vt 0.265625 1.000000 +vt 0.250000 0.875000 +vt 0.187500 0.125000 +vt 0.234375 0.000000 +vt 0.250000 0.750000 +vt 0.187500 0.250000 +vt 0.125000 0.125000 +vt 0.171875 0.000000 +vt 0.203125 1.000000 +vt 0.187500 0.875000 +vt 0.187500 0.375000 +vt 0.187500 0.500000 +vt 0.937500 0.875000 +vt 1.000000 0.750000 +vt 1.000000 0.875000 +vt 0.187500 0.750000 +vt 0.125000 0.625000 +vt 0.078125 1.000000 +vt 0.062500 0.875000 +vt 0.125000 0.875000 +vt 0.125000 0.375000 +vt 0.125000 0.500000 +vt 0.062500 0.375000 +vt 0.062500 0.500000 +vt 0.140625 1.000000 +vt 0.125000 0.750000 +vt 0.125000 0.250000 +vt 0.062500 0.125000 +vt 0.109375 0.000000 +vt 0.000000 0.375000 +vt 0.000000 0.500000 +vt 0.750000 0.500000 +vt 0.062500 0.625000 +vt 0.062500 0.750000 +vt 0.062500 0.250000 +vt 0.000000 0.125000 +vt 0.046875 0.000000 +vt 0.015625 1.000000 +vt 0.000000 0.875000 +vt 0.937500 0.375000 +vt 1.000000 0.500000 +vt 0.937500 0.500000 +vt 0.000000 0.625000 +vt 0.000000 0.750000 +vt 0.000000 0.250000 +vt 0.953125 1.000000 +vt 0.875000 0.375000 +vt 0.875000 0.500000 +vt 0.937500 0.250000 +vt 1.000000 0.250000 +vt 1.000000 0.375000 +vt 0.937500 0.625000 +vt 0.937500 0.750000 +vt 0.937500 0.125000 +vt 1.000000 0.625000 +vt 0.984375 0.000000 +vt 1.000000 0.125000 +vt 0.812500 0.375000 +vt 0.812500 0.500000 +vt 0.875000 0.250000 +vt 0.875000 0.625000 +vt 0.875000 0.750000 +vt 0.875000 0.875000 +vt 0.875000 0.125000 +vt 0.921875 0.000000 +vt 0.890625 1.000000 +vt 0.750000 0.375000 +vt 0.812500 0.875000 +vt 0.796875 0.000000 +vt 0.812500 0.125000 +vt 0.812500 0.250000 +vt 0.859375 0.000000 +vt 0.828125 1.000000 +vt 0.765625 1.000000 +vn 0.3827 0.0000 -0.9239 +vn 0.0000 0.3744 -0.9273 +vn 0.3549 0.3744 -0.8567 +vn -0.0000 1.0000 0.0000 +vn 0.1543 0.9152 -0.3724 +vn -0.0000 0.9152 -0.4031 +vn -0.0000 0.6952 -0.7189 +vn -0.3549 0.3744 -0.8567 +vn -0.2751 0.6952 -0.6641 +vn 0.6557 -0.3744 -0.6557 +vn 0.7071 0.0000 -0.7071 +vn 0.2850 0.9152 -0.2850 +vn 0.2751 0.6952 -0.6641 +vn 0.1543 -0.9152 -0.3724 +vn -0.0000 -1.0000 -0.0000 +vn 0.0000 -0.9152 -0.4031 +vn -0.0000 -0.6952 -0.7189 +vn 0.2751 -0.6952 -0.6641 +vn 0.8567 -0.3744 -0.3549 +vn 0.9239 0.0000 -0.3827 +vn 0.5083 -0.6952 -0.5083 +vn 0.3549 -0.3744 -0.8567 +vn 0.6557 0.3744 -0.6557 +vn 0.5083 0.6952 -0.5083 +vn 0.2850 -0.9152 -0.2850 +vn 0.6641 0.6952 -0.2751 +vn 0.3724 0.9152 -0.1543 +vn 0.9273 0.3744 0.0000 +vn 0.7189 0.6952 0.0000 +vn 0.8567 0.3744 -0.3549 +vn 0.3724 -0.9152 -0.1543 +vn 0.6641 -0.6952 -0.2751 +vn 0.9273 -0.3744 -0.0000 +vn 1.0000 0.0000 -0.0000 +vn 0.3724 -0.9152 0.1543 +vn 0.7189 -0.6952 -0.0000 +vn 0.6641 -0.6952 0.2751 +vn 0.4031 -0.9152 0.0000 +vn 0.4031 0.9152 0.0000 +vn 0.8567 -0.3744 0.3549 +vn 0.9239 0.0000 0.3827 +vn 0.5083 -0.6952 0.5083 +vn 0.8567 0.3744 0.3549 +vn 0.6641 0.6952 0.2751 +vn 0.3724 0.9152 0.1543 +vn 0.6557 -0.3744 0.6557 +vn 0.7071 0.0000 0.7071 +vn 0.6557 0.3744 0.6557 +vn 0.5083 0.6952 0.5083 +vn 0.3827 -0.0000 0.9239 +vn 0.3549 0.3744 0.8567 +vn 0.2850 -0.9152 0.2850 +vn 0.2850 0.9152 0.2850 +vn 0.3549 -0.3744 0.8567 +vn 0.1543 -0.9152 0.3724 +vn 0.2751 -0.6952 0.6641 +vn -0.0000 -0.9152 0.4031 +vn 0.1543 0.9152 0.3724 +vn 0.2751 0.6952 0.6641 +vn 0.0000 -0.3744 0.9273 +vn 0.0000 -0.0000 1.0000 +vn -0.0000 -0.6952 0.7189 +vn -0.3549 0.3744 0.8567 +vn 0.0000 0.3744 0.9273 +vn 0.0000 0.9152 0.4031 +vn -0.1543 -0.9152 0.3724 +vn 0.0000 0.6952 0.7189 +vn -0.2751 -0.6952 0.6641 +vn -0.2850 -0.9152 0.2850 +vn -0.1543 0.9152 0.3724 +vn -0.3549 -0.3744 0.8567 +vn -0.3827 -0.0000 0.9239 +vn -0.3724 0.9152 -0.1543 +vn -0.7189 0.6952 0.0000 +vn -0.4031 0.9152 -0.0000 +vn -0.2751 0.6952 0.6641 +vn -0.6557 0.3744 0.6557 +vn -0.3724 0.9152 0.1543 +vn -0.2850 0.9152 0.2850 +vn -0.6557 -0.3744 0.6557 +vn -0.7071 -0.0000 0.7071 +vn -0.8567 -0.3744 0.3549 +vn -0.9239 -0.0000 0.3827 +vn -0.5083 0.6952 0.5083 +vn -0.5083 -0.6952 0.5083 +vn -0.3724 -0.9152 0.1543 +vn -0.9273 -0.3744 0.0000 +vn -1.0000 -0.0000 0.0000 +vn -0.0000 0.0000 -1.0000 +vn -0.8567 0.3744 0.3549 +vn -0.6641 0.6952 0.2751 +vn -0.6641 -0.6952 0.2751 +vn -0.4031 -0.9152 -0.0000 +vn -0.8567 -0.3744 -0.3549 +vn -0.9239 0.0000 -0.3827 +vn -0.9273 0.3744 0.0000 +vn -0.7189 -0.6952 -0.0000 +vn -0.6557 -0.3744 -0.6557 +vn -0.7071 0.0000 -0.7071 +vn -0.6641 -0.6952 -0.2751 +vn -0.8567 0.3744 -0.3549 +vn -0.6641 0.6952 -0.2751 +vn -0.3724 -0.9152 -0.1543 +vn -0.3549 -0.3744 -0.8567 +vn -0.3827 0.0000 -0.9239 +vn -0.5083 -0.6952 -0.5083 +vn -0.6557 0.3744 -0.6557 +vn -0.5083 0.6952 -0.5083 +vn -0.2850 0.9152 -0.2850 +vn -0.2850 -0.9152 -0.2850 +vn -0.0000 -0.3744 -0.9273 +vn -0.1543 0.9152 -0.3724 +vn -0.1543 -0.9152 -0.3724 +vn -0.2751 -0.6952 -0.6641 +usemtl Default_OBJ +s 1 +f 1/1/1 2/2/2 3/3/3 +f 4/4/4 5/5/5 6/6/6 +f 7/7/7 8/8/8 9/9/9 +f 10/10/10 1/1/1 11/11/11 +f 12/12/12 13/13/13 5/5/5 +f 3/3/3 7/7/7 13/13/13 +f 14/14/14 15/15/15 16/16/16 +f 14/14/14 17/17/17 18/18/18 +f 19/19/19 11/11/11 20/20/20 +f 19/19/19 21/21/21 10/10/10 +f 10/10/10 18/18/18 22/22/22 +f 23/23/23 13/13/13 24/24/24 +f 25/25/25 18/18/18 21/21/21 +f 23/23/23 1/1/1 3/3/3 +f 25/25/25 15/26/15 14/14/14 +f 4/27/4 12/12/12 5/5/5 +f 26/28/26 12/12/12 27/29/27 +f 28/30/28 26/28/26 29/31/29 +f 30/32/30 24/24/24 26/28/26 +f 31/33/31 21/21/21 32/34/32 +f 20/20/20 23/23/23 30/32/30 +f 31/33/31 15/35/15 25/25/25 +f 4/36/4 27/29/27 12/12/12 +f 33/37/33 20/20/20 34/38/34 +f 33/37/33 32/34/32 19/19/19 +f 35/39/35 36/40/36 37/41/37 +f 36/40/36 31/33/31 32/34/32 +f 34/38/34 30/32/30 28/30/28 +f 38/42/38 15/43/15 31/33/31 +f 4/44/4 39/45/39 27/29/27 +f 40/46/40 34/38/34 41/47/41 +f 29/31/29 27/29/27 39/45/39 +f 37/41/37 33/37/33 40/46/40 +f 42/48/42 35/39/35 37/41/37 +f 41/47/41 28/30/28 43/49/43 +f 43/49/43 29/31/29 44/50/44 +f 35/39/35 15/51/15 38/42/38 +f 4/52/4 45/53/45 39/45/39 +f 46/54/46 41/47/41 47/55/47 +f 45/53/45 29/31/29 39/45/39 +f 48/56/48 44/50/44 49/57/49 +f 50/58/50 48/56/48 51/59/51 +f 48/56/48 41/47/41 43/49/43 +f 52/60/52 15/61/15 35/39/35 +f 4/62/4 53/63/53 45/53/45 +f 54/64/54 47/55/47 50/58/50 +f 49/57/49 45/53/45 53/63/53 +f 46/54/46 37/41/37 40/46/40 +f 55/65/55 42/48/42 56/66/56 +f 57/67/57 15/68/15 55/65/55 +f 55/65/55 15/69/15 52/60/52 +f 4/70/4 58/71/58 53/63/53 +f 59/72/59 53/63/53 58/71/58 +f 60/73/60 50/58/50 61/74/61 +f 54/64/54 42/48/42 46/54/46 +f 51/59/51 49/57/49 59/72/59 +f 62/75/62 55/65/55 56/66/56 +f 63/76/63 61/74/61 64/77/64 +f 4/78/4 65/79/65 58/71/58 +f 61/74/61 51/59/51 64/77/64 +f 66/80/66 15/81/15 57/67/57 +f 67/82/67 58/71/58 65/79/65 +f 62/75/62 54/64/54 60/73/60 +f 64/77/64 59/72/59 67/82/67 +f 66/80/66 62/75/62 68/83/68 +f 69/84/69 15/85/15 66/80/66 +f 4/86/4 70/87/70 65/79/65 +f 71/88/71 61/74/61 72/89/72 +f 73/90/73 74/91/74 75/92/75 +f 76/93/76 65/79/65 70/87/70 +f 71/88/71 62/75/62 60/73/60 +f 63/76/63 67/82/67 76/93/76 +f 77/94/77 72/89/72 63/76/63 +f 4/95/4 78/96/78 79/97/79 +f 80/98/80 72/89/72 81/99/81 +f 82/100/82 81/99/81 83/101/83 +f 4/102/4 79/97/79 70/87/70 +f 80/98/80 68/83/68 71/88/71 +f 77/94/77 76/93/76 84/103/84 +f 69/84/69 68/83/68 85/104/85 +f 86/105/86 15/106/15 69/84/69 +f 87/107/87 83/101/83 88/108/88 +f 78/96/78 84/103/84 79/97/79 +f 22/22/22 89/109/89 1/1/1 +f 82/100/82 85/104/85 80/98/80 +f 90/110/90 84/103/84 91/111/91 +f 86/105/86 85/104/85 92/112/92 +f 90/110/90 81/99/81 77/94/77 +f 93/113/93 15/114/15 86/105/86 +f 4/115/4 75/116/75 78/96/78 +f 94/117/94 88/118/88 95/119/95 +f 75/116/75 91/111/91 78/96/78 +f 87/107/87 92/112/92 82/100/82 +f 96/120/96 91/111/91 74/121/74 +f 97/122/97 86/105/86 92/112/92 +f 96/120/96 83/101/83 90/110/90 +f 4/123/4 73/90/73 75/92/75 +f 98/124/98 95/119/95 99/125/99 +f 98/124/98 100/126/100 94/117/94 +f 94/117/94 97/127/97 87/128/87 +f 101/129/101 74/91/74 102/130/102 +f 103/131/103 97/127/97 100/126/100 +f 101/129/101 88/118/88 96/132/96 +f 103/131/103 15/133/15 93/134/93 +f 104/135/104 99/125/99 105/136/105 +f 104/135/104 106/137/106 98/124/98 +f 107/138/107 102/130/102 108/139/108 +f 109/140/109 102/130/102 73/90/73 +f 110/141/110 100/126/100 106/137/106 +f 107/138/107 95/119/95 101/129/101 +f 110/141/110 15/142/15 103/131/103 +f 4/143/4 109/140/109 73/90/73 +f 111/144/111 105/136/105 89/109/89 +f 9/9/9 109/140/109 112/145/112 +f 16/16/16 15/146/15 113/147/113 +f 8/8/8 108/139/108 9/9/9 +f 113/147/113 106/137/106 114/148/114 +f 8/8/8 99/125/99 107/138/107 +f 113/147/113 15/149/15 110/141/110 +f 4/150/4 112/145/112 109/140/109 +f 13/13/13 6/6/6 5/5/5 +f 18/18/18 111/144/111 22/22/22 +f 17/17/17 113/147/113 114/148/114 +f 2/2/2 105/136/105 8/8/8 +f 4/151/4 6/6/6 112/145/112 +f 111/144/111 114/148/114 104/135/104 +f 6/6/6 9/9/9 112/145/112 +f 84/103/84 70/87/70 79/97/79 +f 1/1/1 89/109/89 2/2/2 +f 7/7/7 2/2/2 8/8/8 +f 10/10/10 22/22/22 1/1/1 +f 12/12/12 24/24/24 13/13/13 +f 3/3/3 2/2/2 7/7/7 +f 14/14/14 16/16/16 17/17/17 +f 19/19/19 10/10/10 11/11/11 +f 19/19/19 32/34/32 21/21/21 +f 10/10/10 21/21/21 18/18/18 +f 23/23/23 3/3/3 13/13/13 +f 25/25/25 14/14/14 18/18/18 +f 23/23/23 11/11/11 1/1/1 +f 26/28/26 24/24/24 12/12/12 +f 28/30/28 30/32/30 26/28/26 +f 30/32/30 23/23/23 24/24/24 +f 31/33/31 25/25/25 21/21/21 +f 20/20/20 11/11/11 23/23/23 +f 33/37/33 19/19/19 20/20/20 +f 33/37/33 36/40/36 32/34/32 +f 35/39/35 38/42/38 36/40/36 +f 36/40/36 38/42/38 31/33/31 +f 34/38/34 20/20/20 30/32/30 +f 40/46/40 33/37/33 34/38/34 +f 29/31/29 26/28/26 27/29/27 +f 37/41/37 36/40/36 33/37/33 +f 42/48/42 52/60/52 35/39/35 +f 41/47/41 34/38/34 28/30/28 +f 43/49/43 28/30/28 29/31/29 +f 46/54/46 40/46/40 41/47/41 +f 45/53/45 44/50/44 29/31/29 +f 48/56/48 43/49/43 44/50/44 +f 50/58/50 47/55/47 48/56/48 +f 48/56/48 47/55/47 41/47/41 +f 54/64/54 46/54/46 47/55/47 +f 49/57/49 44/50/44 45/53/45 +f 46/54/46 42/48/42 37/41/37 +f 55/65/55 52/60/52 42/48/42 +f 59/72/59 49/57/49 53/63/53 +f 60/73/60 54/64/54 50/58/50 +f 54/64/54 56/66/56 42/48/42 +f 51/59/51 48/56/48 49/57/49 +f 62/75/62 57/67/57 55/65/55 +f 63/76/63 72/89/72 61/74/61 +f 61/74/61 50/58/50 51/59/51 +f 67/82/67 59/72/59 58/71/58 +f 62/75/62 56/66/56 54/64/54 +f 64/77/64 51/59/51 59/72/59 +f 66/80/66 57/67/57 62/75/62 +f 71/88/71 60/73/60 61/74/61 +f 73/90/73 102/130/102 74/91/74 +f 76/93/76 67/82/67 65/79/65 +f 71/88/71 68/83/68 62/75/62 +f 63/76/63 64/77/64 67/82/67 +f 77/94/77 81/99/81 72/89/72 +f 80/98/80 71/88/71 72/89/72 +f 82/100/82 80/98/80 81/99/81 +f 80/98/80 85/104/85 68/83/68 +f 77/94/77 63/76/63 76/93/76 +f 69/84/69 66/80/66 68/83/68 +f 87/107/87 82/100/82 83/101/83 +f 78/96/78 91/111/91 84/103/84 +f 22/22/22 111/144/111 89/109/89 +f 82/100/82 92/112/92 85/104/85 +f 90/110/90 77/94/77 84/103/84 +f 86/105/86 69/84/69 85/104/85 +f 90/110/90 83/101/83 81/99/81 +f 94/117/94 87/128/87 88/118/88 +f 75/116/75 74/121/74 91/111/91 +f 87/107/87 97/122/97 92/112/92 +f 96/120/96 90/110/90 91/111/91 +f 97/122/97 93/113/93 86/105/86 +f 96/120/96 88/108/88 83/101/83 +f 98/124/98 94/117/94 95/119/95 +f 98/124/98 106/137/106 100/126/100 +f 94/117/94 100/126/100 97/127/97 +f 101/129/101 96/132/96 74/91/74 +f 103/131/103 93/134/93 97/127/97 +f 101/129/101 95/119/95 88/118/88 +f 104/135/104 98/124/98 99/125/99 +f 104/135/104 114/148/114 106/137/106 +f 107/138/107 101/129/101 102/130/102 +f 109/140/109 108/139/108 102/130/102 +f 110/141/110 103/131/103 100/126/100 +f 107/138/107 99/125/99 95/119/95 +f 111/144/111 104/135/104 105/136/105 +f 9/9/9 108/139/108 109/140/109 +f 8/8/8 107/138/107 108/139/108 +f 113/147/113 110/141/110 106/137/106 +f 8/8/8 105/136/105 99/125/99 +f 13/13/13 7/7/7 6/6/6 +f 18/18/18 17/17/17 111/144/111 +f 17/17/17 16/16/16 113/147/113 +f 2/2/2 89/109/89 105/136/105 +f 111/144/111 17/17/17 114/148/114 +f 6/6/6 7/7/7 9/9/9 +f 84/103/84 76/93/76 70/87/70 diff --git a/godot/Models/ball.obj.import b/godot/Models/ball.obj.import new file mode 100644 index 0000000..09876b9 --- /dev/null +++ b/godot/Models/ball.obj.import @@ -0,0 +1,21 @@ +[remap] + +importer="wavefront_obj" +importer_version=1 +type="Mesh" +uid="uid://dpgqjgkd2kx4b" +path="res://.godot/imported/ball.obj-63d20b0a9ce44f76b9838ac1af5672bf.mesh" + +[deps] + +files=["res://.godot/imported/ball.obj-63d20b0a9ce44f76b9838ac1af5672bf.mesh"] + +source_file="res://Models/ball.obj" +dest_files=["res://.godot/imported/ball.obj-63d20b0a9ce44f76b9838ac1af5672bf.mesh", "res://.godot/imported/ball.obj-63d20b0a9ce44f76b9838ac1af5672bf.mesh"] + +[params] + +generate_tangents=true +scale_mesh=Vector3(1, 1, 1) +offset_mesh=Vector3(0, 0, 0) +optimize_mesh=true diff --git a/godot/Player.gd b/godot/Player.gd index 4bec377..9180a29 100644 --- a/godot/Player.gd +++ b/godot/Player.gd @@ -112,6 +112,15 @@ func _physics_process(delta): velocity.z = move_toward(velocity.z, 0, SPEED) move_and_slide() + + var push = 0.01 + # after calling move_and_slide() + for index in get_slide_collision_count(): + var c = get_slide_collision(index) + var collision = c.get_collider() + if "is_pushable" not in collision: + continue + collision.apply_central_impulse(-c.get_normal() * push) func drop(): var obj: Node3D = holding.get_ref() @@ -127,6 +136,7 @@ func drop(): obj.rotate_y(deg_to_rad(-90)) obj.translate_object_local(Vector3(0.125, 0.0, 0.0)) obj.set_process(true) + obj.set_physics_process(true) holding = weakref(null) func _on_grape_man_anim_check_grab(_position): @@ -140,6 +150,7 @@ func _on_grape_man_anim_check_grab(_position): add_collision_exception_with(obj) obj.set_process(false) + obj.set_physics_process(false) func _on_holster_enter(body): if target.get_ref() or holding.get_ref() or "is_holdable" not in body: diff --git a/godot/Textures/ball.png b/godot/Textures/ball.png new file mode 100644 index 0000000..ad12abc --- /dev/null +++ b/godot/Textures/ball.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae9d0659a498c65fa8fe7d2fc04b7c46b9dcc05f67eeb6b9d40e18ed65a3eab9 +size 2801 diff --git a/godot/Textures/ball.png.import b/godot/Textures/ball.png.import new file mode 100644 index 0000000..64dfd38 --- /dev/null +++ b/godot/Textures/ball.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cuc1p8nq2vs6p" +path.s3tc="res://.godot/imported/ball.png-bc91096d257a7ab889f72eb03aef0a7c.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://Textures/ball.png" +dest_files=["res://.godot/imported/ball.png-bc91096d257a7ab889f72eb03aef0a7c.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/godot/crate.tscn b/godot/crate.tscn new file mode 100644 index 0000000..38efdea --- /dev/null +++ b/godot/crate.tscn @@ -0,0 +1,24 @@ +[gd_scene load_steps=6 format=3 uid="uid://ckbba1bs71tl"] + +[ext_resource type="Script" path="res://Crate.gd" id="1_alhhi"] +[ext_resource type="Texture2D" uid="uid://cuc1p8nq2vs6p" path="res://Textures/ball.png" id="2_raef5"] +[ext_resource type="ArrayMesh" uid="uid://dpgqjgkd2kx4b" path="res://Models/ball.obj" id="3_78csp"] + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_si821"] +albedo_texture = ExtResource("2_raef5") + +[sub_resource type="SphereShape3D" id="SphereShape3D_i5qy0"] +radius = 0.05 + +[node name="Crate" type="RigidBody3D"] +gravity_scale = 0.1 +angular_damp = 10.0 +script = ExtResource("1_alhhi") + +[node name="MeshInstance3D" type="MeshInstance3D" parent="."] +transform = Transform3D(0.3, 0, 0, 0, 0.3, 0, 0, 0, 0.3, 0, 0, 0) +material_override = SubResource("StandardMaterial3D_si821") +mesh = ExtResource("3_78csp") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +shape = SubResource("SphereShape3D_i5qy0") diff --git a/textures/ball.png b/textures/ball.png new file mode 100644 index 0000000000000000000000000000000000000000..46f7ef5dae253f58237106d338c5162e4d4cf9f9 GIT binary patch literal 2801 zcmeH}`%lwX6u|Gd&`Haby7JJ8P@GYiRhYVgKy4{3JXBh(x?)hOW`LqpVOdeSe!t)Y z-#R8K0kP;}&`hDmAjB40ajv33MYdE|pp{aKX@O#GSLoxrZ~bM-vOi!yaFdgBa&pei zJ@@rFr`g%*bBUi40RVF|Gt#yI0AVHs0zSf2ZpqDjOc4%caHvRfOtAH zEoEyNG(Nbw_>b*jcwSzjUs>h8(UpFC!p|LpjOX_$$s40OE(Bj5t~{fPukGUZxgEy%Dhu1$+P=ABU&VMmisS>JePjhtM7?jURFo%m5E&N5zb<#S@GHn zubZeB=efJ{=%Sgma<|9X9glL>(_m{a-RMp^vT>clte()l_qv`r;CA4se_jPDN&}*i zQcM3f(t=OeAoT##|0up$;pcIGnE}0@=pXgpQ(?ec?M1>DV_;I3K9yjZ+1oV+9FbE) zCu3vb@ODqV!gJIeqvr=58RO?R2idlZa?vc0`BN}pYa$lr+_bi5FK3*QDJckODWHD$PC z(S>Zn18>Z^M|19?yB}!vTxc-jvBp1OD=`{*+Pbh#84ls&RQ;PV$GH%s;B}FBJjb~M zB@dx{Cn1ab>WP*P0xdAl3|G5g%W|Y)_@1>jz7dP_uu9O2VZIDLL*1pBk&JpHV*zFj zBUqB1-tD390!7me4WNR6Bl2+9Q%Qv(Y;dQ3O+4l>;169dxR!dM89sGz#}gTe6Rpzu zy=1}F1=k)`H^a5XSGa)<)cZOUT$_BmKHA%DSvs*WNZDya$?050M|0?womiBwkXHKD0dQc#E2z8CM z@wE=)hO$ePiJ5VQ)2oJYFBQ-?A_ret6RA;bfwdO;J9Qu>u_F$`t-#ol^@C}dl*@pq zyO04gH|A29@~_DiCf)ruzUHdV-ePYead`M zge^6VoV#js@;sThHZBqI1lf!jf14cC!F$$`g4d69H1)#~7aa}ZrCX`)>Fr!w0miF# zx}??Vm2iNX%U@4b__!8A&GHjg_L%#HE5oC7!k=Ev{BU)JeId zbGpeL4><jM{8yS6>Cqgh6~H-3^CeqS^b!uyj2N$8Ogy#0EE>Q+^fFir#49@ww+ z29@@?P~hN{hlLg~7X_RO4zLMarkY94^NB&m*|0NNNm< zomUfy4Vt(=pQXetvnm9jI=#}>GXJ7R{W4l(wUbT9(4Of5_r77f7S+cq&$!S$Tz}uh n@)Judu}*c~x7^J9O`E{ym>qzLZ@l3A Date: Sun, 20 Aug 2023 16:27:51 -0600 Subject: [PATCH 3/5] a --- godot/Level/Island.tscn | 6 +++--- godot/Models/grape_man.tscn | 12 +++++++++--- godot/Models/island.tscn | 6 +----- godot/player.tscn | 9 ++++++--- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/godot/Level/Island.tscn b/godot/Level/Island.tscn index 50ff3f0..a09b494 100644 --- a/godot/Level/Island.tscn +++ b/godot/Level/Island.tscn @@ -22,10 +22,10 @@ [ext_resource type="PackedScene" uid="uid://c4s6y758n77lw" path="res://villager_shared.tscn" id="24_ddfvk"] [ext_resource type="PackedScene" uid="uid://b3aus2kigf8xt" path="res://Models/beach_decor/cooler.tscn" id="24_sl7ne"] [ext_resource type="PackedScene" uid="uid://cft26nug7kyqb" path="res://ambient_light_1.tscn" id="25_novxt"] -[ext_resource type="PackedScene" path="res://color_cube.tscn" id="25_rm0cr"] -[ext_resource type="PackedScene" path="res://slime_kill_box.tscn" id="27_cjxk6"] +[ext_resource type="PackedScene" uid="uid://ukful430mmkn" path="res://color_cube.tscn" id="25_rm0cr"] +[ext_resource type="PackedScene" uid="uid://d2pvg0f5jtpve" path="res://slime_kill_box.tscn" id="27_cjxk6"] [ext_resource type="PackedScene" uid="uid://bw3k2c75qavce" path="res://Models/beach_decor/bucket.tscn" id="27_f3p1i"] -[ext_resource type="PackedScene" path="res://Level/World/DayNightEnvironment.tscn" id="27_jutn4"] +[ext_resource type="PackedScene" uid="uid://6ycop5t3nra5" path="res://Level/World/DayNightEnvironment.tscn" id="27_jutn4"] [ext_resource type="PackedScene" uid="uid://g4gmc0pwlak1" path="res://Models/buildings/fence.tscn" id="28_prydb"] [ext_resource type="PackedScene" uid="uid://ckbba1bs71tl" path="res://crate.tscn" id="28_x0lrj"] diff --git a/godot/Models/grape_man.tscn b/godot/Models/grape_man.tscn index bee880f..759ad10 100644 --- a/godot/Models/grape_man.tscn +++ b/godot/Models/grape_man.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=41 format=3 uid="uid://bgoo1lbt28na"] +[gd_scene load_steps=42 format=3 uid="uid://bgoo1lbt28na"] [ext_resource type="PackedScene" uid="uid://bhanbx2dyhv2d" path="res://Models/grape_man.glb" id="1_fh5yr"] [ext_resource type="Script" path="res://Models/grape_man.gd" id="2_ksje8"] @@ -6,6 +6,7 @@ [ext_resource type="AudioStream" uid="uid://baocyd0p3jcku" path="res://Sounds/pickup_grunt.ogg" id="4_nvurj"] [ext_resource type="AudioStream" uid="uid://b80t5xqckjoqk" path="res://Sounds/heartychuckle.ogg" id="5_b32re"] [ext_resource type="AudioStream" uid="uid://0mhkf1ls1wcn" path="res://Sounds/sadsound.ogg" id="6_qe4bi"] +[ext_resource type="AudioStream" uid="uid://bmocmgq06o6f5" path="res://Sounds/footstep.ogg" id="7_b2ik0"] [sub_resource type="AnimationNodeAdd2" id="AnimationNodeAdd2_a0vxm"] filters = ["rig/Skeleton3D:forearm.L", "rig/Skeleton3D:forearm.R", "rig/Skeleton3D:head", "rig/Skeleton3D:upper_arm.L", "rig/Skeleton3D:upper_arm.R"] @@ -154,7 +155,7 @@ transform = Transform3D(0.065, 0, 0, 0, 0.065, 0, 0, 0, 0.065, 0, 0, 0) script = ExtResource("2_ksje8") [node name="Skeleton3D" parent="rig" index="0"] -bones/0/rotation = Quaternion(0.0664168, 0, 0, 0.997792) +bones/0/rotation = Quaternion(0.0733902, 0, 0, 0.997303) bones/1/rotation = Quaternion(-0.0891896, 1.18734e-07, -1.06322e-08, 0.996015) bones/2/rotation = Quaternion(0.0133933, -1.19199e-07, 1.5966e-09, 0.99991) bones/3/rotation = Quaternion(-0.00997737, 0.100365, -0.694951, 0.711948) @@ -169,6 +170,7 @@ bones/15/rotation = Quaternion(0.105246, -0.0039338, 0.0113526, 0.994374) [node name="OmniLight3D" type="OmniLight3D" parent="." index="2"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.289473, 8.26292, 4.26359) +light_energy = 0.5 [node name="AnimationTree" type="AnimationTree" parent="." index="3"] tree_root = SubResource("AnimationNodeStateMachine_6mfdu") @@ -191,5 +193,9 @@ stream = ExtResource("5_b32re") [node name="sad" type="AudioStreamPlayer" parent="." index="7"] stream = ExtResource("6_qe4bi") -[node name="woohoo" type="AudioStreamPlayer" parent="." index="8"] +[node name="soundboard" type="AudioStreamPlayer" parent="." index="8"] stream = ExtResource("6_qe4bi") + +[node name="footstep" type="AudioStreamPlayer" parent="." index="9"] +stream = ExtResource("7_b2ik0") +volume_db = -10.0 diff --git a/godot/Models/island.tscn b/godot/Models/island.tscn index 2d39693..e29ec4f 100644 --- a/godot/Models/island.tscn +++ b/godot/Models/island.tscn @@ -1,15 +1,11 @@ -[gd_scene load_steps=5 format=3 uid="uid://difi2tur2j4dg"] +[gd_scene load_steps=4 format=3 uid="uid://difi2tur2j4dg"] [ext_resource type="PackedScene" uid="uid://dfyt6kjw8yli" path="res://Models/island.glb" id="1_5vc8b"] [ext_resource type="Script" path="res://Models/island.gd" id="2_1q8nk"] [ext_resource type="Material" uid="uid://yuhlhpwji3c4" path="res://Textures/sand.tres" id="2_nhexh"] -[ext_resource type="Material" uid="uid://b88xmds4mx7rd" path="res://Textures/grass.tres" id="4_uusb2"] [node name="island" instance=ExtResource("1_5vc8b")] script = ExtResource("2_1q8nk") [node name="Island" parent="." index="0"] material_override = ExtResource("2_nhexh") - -[node name="Island_001" parent="." index="2"] -surface_material_override/0 = ExtResource("4_uusb2") diff --git a/godot/player.tscn b/godot/player.tscn index 4b969c4..55e8271 100644 --- a/godot/player.tscn +++ b/godot/player.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=6 format=3 uid="uid://7utef1nnena8"] +[gd_scene load_steps=7 format=3 uid="uid://7utef1nnena8"] [ext_resource type="Script" path="res://Player.gd" id="1_7gpdp"] [ext_resource type="PackedScene" uid="uid://bgoo1lbt28na" path="res://Models/grape_man.tscn" id="2_ctyy5"] [ext_resource type="Script" path="res://Holster.gd" id="3_a68da"] +[ext_resource type="PackedScene" uid="uid://cbca7q18ae42h" path="res://UI/PauseMenu.tscn" id="4_kcqpl"] [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_kb4ms"] radius = 0.0669067 @@ -24,8 +25,7 @@ shape = SubResource("CapsuleShape3D_kb4ms") transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.389874, 0) [node name="PlayerCam" type="Camera3D" parent="CameraMount"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.643936) -current = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.930216) fov = 50.0 [node name="Holster" type="Node3D" parent="."] @@ -37,6 +37,9 @@ script = ExtResource("3_a68da") transform = Transform3D(0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0, 0.0672282, 0) shape = SubResource("SphereShape3D_6l1w6") +[node name="PauseMenu" parent="." instance=ExtResource("4_kcqpl")] +visible = false + [connection signal="anim_check_grab" from="grape_man" to="." method="_on_grape_man_anim_check_grab"] [connection signal="body_entered" from="Holster/Area3D" to="." method="_on_holster_enter"] [connection signal="body_exited" from="Holster/Area3D" to="." method="_on_holster_exit"] From 9712819295ed7209c2f75c9a8802e3dfc78354fd Mon Sep 17 00:00:00 2001 From: Spencer Killen Date: Sun, 20 Aug 2023 16:31:27 -0600 Subject: [PATCH 4/5] fix glitched beachball --- godot/Level/Island.tscn | 1 - godot/Player.gd | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/godot/Level/Island.tscn b/godot/Level/Island.tscn index a09b494..64023ef 100644 --- a/godot/Level/Island.tscn +++ b/godot/Level/Island.tscn @@ -484,7 +484,6 @@ shape = SubResource("BoxShape3D_um2bu") [node name="Crate" parent="." instance=ExtResource("28_x0lrj")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 2.44712, -1) -mass = 0.01 [node name="Crate3" parent="." instance=ExtResource("28_x0lrj")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.75088, 2.39766, -4.28161) diff --git a/godot/Player.gd b/godot/Player.gd index 0bba157..3436207 100644 --- a/godot/Player.gd +++ b/godot/Player.gd @@ -110,7 +110,7 @@ func _physics_process(delta): move_and_slide() - var push = 0.01 + var push = 0.1 # after calling move_and_slide() for index in get_slide_collision_count(): var c = get_slide_collision(index) From 7c47381d86435b99df5345e2f311519b456c573a Mon Sep 17 00:00:00 2001 From: ncusimano Date: Sun, 20 Aug 2023 16:43:13 -0600 Subject: [PATCH 5/5] Spawner Added On top of skyscraper :) --- godot/CameraTest.tscn | 6 +++++- godot/Level/Island.tscn | 14 +++++++++----- godot/Models/grape_man.tscn | 12 +++--------- godot/player.tscn | 2 +- godot/spawner.gd | 30 ++++++++++++++++++++++++++++++ godot/spawner.tscn | 10 ++++++++++ 6 files changed, 58 insertions(+), 16 deletions(-) create mode 100644 godot/spawner.gd create mode 100644 godot/spawner.tscn diff --git a/godot/CameraTest.tscn b/godot/CameraTest.tscn index fc9da98..02fbd56 100644 --- a/godot/CameraTest.tscn +++ b/godot/CameraTest.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=6 format=3 uid="uid://cdm267rtmop75"] +[gd_scene load_steps=7 format=3 uid="uid://cdm267rtmop75"] [ext_resource type="PackedScene" uid="uid://c4s6y758n77lw" path="res://villager_shared.tscn" id="1_6uu34"] [ext_resource type="PackedScene" uid="uid://7utef1nnena8" path="res://player.tscn" id="1_jbc4n"] [ext_resource type="PackedScene" uid="uid://e0s4phx2jiit" path="res://cultist.tscn" id="3_renxb"] +[ext_resource type="PackedScene" uid="uid://d0uw7ykhb1cx8" path="res://spawner.tscn" id="4_ib8u6"] [sub_resource type="CylinderMesh" id="CylinderMesh_c2b6h"] top_radius = 80.23 @@ -32,3 +33,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.87818, 2, 0.191837) [node name="Player" parent="." instance=ExtResource("1_jbc4n")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.140476, 0.999999, 1.27725) + +[node name="Node3D" parent="." instance=ExtResource("4_ib8u6")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 3) diff --git a/godot/Level/Island.tscn b/godot/Level/Island.tscn index 64023ef..9f48542 100644 --- a/godot/Level/Island.tscn +++ b/godot/Level/Island.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=33 format=3 uid="uid://3d51hjh2st8a"] +[gd_scene load_steps=34 format=3 uid="uid://3d51hjh2st8a"] [ext_resource type="PackedScene" uid="uid://d2d4uv7o5gx5p" path="res://Level/World/screen_shader.tscn" id="1_huyen"] [ext_resource type="PackedScene" uid="uid://d3ccrfjpg4hbv" path="res://Models/palm_curved.tscn" id="3_bth2b"] @@ -22,12 +22,13 @@ [ext_resource type="PackedScene" uid="uid://c4s6y758n77lw" path="res://villager_shared.tscn" id="24_ddfvk"] [ext_resource type="PackedScene" uid="uid://b3aus2kigf8xt" path="res://Models/beach_decor/cooler.tscn" id="24_sl7ne"] [ext_resource type="PackedScene" uid="uid://cft26nug7kyqb" path="res://ambient_light_1.tscn" id="25_novxt"] -[ext_resource type="PackedScene" uid="uid://ukful430mmkn" path="res://color_cube.tscn" id="25_rm0cr"] -[ext_resource type="PackedScene" uid="uid://d2pvg0f5jtpve" path="res://slime_kill_box.tscn" id="27_cjxk6"] +[ext_resource type="PackedScene" path="res://color_cube.tscn" id="25_rm0cr"] +[ext_resource type="PackedScene" path="res://slime_kill_box.tscn" id="27_cjxk6"] [ext_resource type="PackedScene" uid="uid://bw3k2c75qavce" path="res://Models/beach_decor/bucket.tscn" id="27_f3p1i"] -[ext_resource type="PackedScene" uid="uid://6ycop5t3nra5" path="res://Level/World/DayNightEnvironment.tscn" id="27_jutn4"] +[ext_resource type="PackedScene" path="res://Level/World/DayNightEnvironment.tscn" id="27_jutn4"] [ext_resource type="PackedScene" uid="uid://g4gmc0pwlak1" path="res://Models/buildings/fence.tscn" id="28_prydb"] -[ext_resource type="PackedScene" uid="uid://ckbba1bs71tl" path="res://crate.tscn" id="28_x0lrj"] +[ext_resource type="PackedScene" path="res://crate.tscn" id="28_x0lrj"] +[ext_resource type="PackedScene" uid="uid://d0uw7ykhb1cx8" path="res://spawner.tscn" id="29_etvc6"] [sub_resource type="Animation" id="Animation_jpnyu"] resource_name = "waves" @@ -491,6 +492,9 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.75088, 2.39766, -4.28161) [node name="Crate4" parent="." instance=ExtResource("28_x0lrj")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.31447, 2.55588, -2.13044) +[node name="Node3D" parent="." instance=ExtResource("29_etvc6")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.41845, 9.26863, -2.62281) + [connection signal="finished" from="Music" to="Music" method="_on_finished"] [connection signal="timeout" from="Music/Transition" to="Music" method="_on_transition_timer_timeout"] [connection signal="timeout" from="Music/Tween" to="Music" method="_on_tween_timer_timeout"] diff --git a/godot/Models/grape_man.tscn b/godot/Models/grape_man.tscn index 759ad10..017e66a 100644 --- a/godot/Models/grape_man.tscn +++ b/godot/Models/grape_man.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=42 format=3 uid="uid://bgoo1lbt28na"] +[gd_scene load_steps=41 format=3 uid="uid://bgoo1lbt28na"] [ext_resource type="PackedScene" uid="uid://bhanbx2dyhv2d" path="res://Models/grape_man.glb" id="1_fh5yr"] [ext_resource type="Script" path="res://Models/grape_man.gd" id="2_ksje8"] @@ -6,7 +6,6 @@ [ext_resource type="AudioStream" uid="uid://baocyd0p3jcku" path="res://Sounds/pickup_grunt.ogg" id="4_nvurj"] [ext_resource type="AudioStream" uid="uid://b80t5xqckjoqk" path="res://Sounds/heartychuckle.ogg" id="5_b32re"] [ext_resource type="AudioStream" uid="uid://0mhkf1ls1wcn" path="res://Sounds/sadsound.ogg" id="6_qe4bi"] -[ext_resource type="AudioStream" uid="uid://bmocmgq06o6f5" path="res://Sounds/footstep.ogg" id="7_b2ik0"] [sub_resource type="AnimationNodeAdd2" id="AnimationNodeAdd2_a0vxm"] filters = ["rig/Skeleton3D:forearm.L", "rig/Skeleton3D:forearm.R", "rig/Skeleton3D:head", "rig/Skeleton3D:upper_arm.L", "rig/Skeleton3D:upper_arm.R"] @@ -155,7 +154,7 @@ transform = Transform3D(0.065, 0, 0, 0, 0.065, 0, 0, 0, 0.065, 0, 0, 0) script = ExtResource("2_ksje8") [node name="Skeleton3D" parent="rig" index="0"] -bones/0/rotation = Quaternion(0.0733902, 0, 0, 0.997303) +bones/0/rotation = Quaternion(0.0684942, 0, 0, 0.997652) bones/1/rotation = Quaternion(-0.0891896, 1.18734e-07, -1.06322e-08, 0.996015) bones/2/rotation = Quaternion(0.0133933, -1.19199e-07, 1.5966e-09, 0.99991) bones/3/rotation = Quaternion(-0.00997737, 0.100365, -0.694951, 0.711948) @@ -170,7 +169,6 @@ bones/15/rotation = Quaternion(0.105246, -0.0039338, 0.0113526, 0.994374) [node name="OmniLight3D" type="OmniLight3D" parent="." index="2"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.289473, 8.26292, 4.26359) -light_energy = 0.5 [node name="AnimationTree" type="AnimationTree" parent="." index="3"] tree_root = SubResource("AnimationNodeStateMachine_6mfdu") @@ -193,9 +191,5 @@ stream = ExtResource("5_b32re") [node name="sad" type="AudioStreamPlayer" parent="." index="7"] stream = ExtResource("6_qe4bi") -[node name="soundboard" type="AudioStreamPlayer" parent="." index="8"] +[node name="woohoo" type="AudioStreamPlayer" parent="." index="8"] stream = ExtResource("6_qe4bi") - -[node name="footstep" type="AudioStreamPlayer" parent="." index="9"] -stream = ExtResource("7_b2ik0") -volume_db = -10.0 diff --git a/godot/player.tscn b/godot/player.tscn index 55e8271..cff76ff 100644 --- a/godot/player.tscn +++ b/godot/player.tscn @@ -25,7 +25,7 @@ shape = SubResource("CapsuleShape3D_kb4ms") transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.389874, 0) [node name="PlayerCam" type="Camera3D" parent="CameraMount"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.930216) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.643936) fov = 50.0 [node name="Holster" type="Node3D" parent="."] diff --git a/godot/spawner.gd b/godot/spawner.gd new file mode 100644 index 0000000..ac68b03 --- /dev/null +++ b/godot/spawner.gd @@ -0,0 +1,30 @@ +extends Node3D + +var rng = RandomNumberGenerator.new() +var spawnableItems: Array + +# Called when the node enters the scene tree for the first time. +func _ready(): + $SpawnTimer.wait_time = 10 + $SpawnTimer.one_shot = true + + spawnableItems.append(load("res://cultist.tscn")) + spawnableItems.append(load("res://villager_shared.tscn")) + + $SpawnTimer.start() + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + +func _on_spawn_timer_timeout(): + var item_to_spawn = rng.randi_range(0, spawnableItems.size() - 1) + var spawned_item = spawnableItems[item_to_spawn].instantiate() + get_parent_node_3d().add_child(spawned_item) + + spawned_item.set_global_position(global_transform.origin) + spawned_item.set_velocity(Vector3(rng.randf_range(0, 3), rng.randf_range(1, 3), rng.randf_range(0, 3))) + + # Start the timer again at a random rate. + $SpawnTimer.wait_time = rng.randi_range(120, 300) + $SpawnTimer.start() diff --git a/godot/spawner.tscn b/godot/spawner.tscn new file mode 100644 index 0000000..788b1ea --- /dev/null +++ b/godot/spawner.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=2 format=3 uid="uid://d0uw7ykhb1cx8"] + +[ext_resource type="Script" path="res://spawner.gd" id="1_xameb"] + +[node name="Spawner" type="Node3D"] +script = ExtResource("1_xameb") + +[node name="SpawnTimer" type="Timer" parent="."] + +[connection signal="timeout" from="SpawnTimer" to="." method="_on_spawn_timer_timeout"]