diff --git a/blends/giant.blend b/blends/giant.blend index b6745d5..af74f3d 100644 Binary files a/blends/giant.blend and b/blends/giant.blend differ diff --git a/blends/giant.blend1 b/blends/giant.blend1 index fdefc2d..50593a5 100644 Binary files a/blends/giant.blend1 and b/blends/giant.blend1 differ diff --git a/godot/Level/Island.tscn b/godot/Level/Island.tscn index 5c70f0a..5ecebbd 100644 --- a/godot/Level/Island.tscn +++ b/godot/Level/Island.tscn @@ -23,7 +23,7 @@ [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" uid="uid://ukful430mmkn" path="res://color_cube.tscn" id="25_rm0cr"] [ext_resource type="PackedScene" uid="uid://bw3k2c75qavce" path="res://Models/beach_decor/bucket.tscn" id="27_f3p1i"] [ext_resource type="PackedScene" uid="uid://g4gmc0pwlak1" path="res://Models/buildings/fence.tscn" id="28_prydb"] diff --git a/godot/Models/grape_animations/pickup.res b/godot/Models/grape_animations/pickup.res index 0471c90..199e933 100644 Binary files a/godot/Models/grape_animations/pickup.res and b/godot/Models/grape_animations/pickup.res differ diff --git a/godot/Models/grape_animations/upper_body_holding.res b/godot/Models/grape_animations/upper_body_holding.res index 4fc0701..7badc09 100644 Binary files a/godot/Models/grape_animations/upper_body_holding.res and b/godot/Models/grape_animations/upper_body_holding.res differ diff --git a/godot/Models/grape_animations/upper_body_idle.res.res b/godot/Models/grape_animations/upper_body_idle.res.res index fd30d7a..0f2924d 100644 Binary files a/godot/Models/grape_animations/upper_body_idle.res.res and b/godot/Models/grape_animations/upper_body_idle.res.res differ diff --git a/godot/Models/grape_animations/walk.res b/godot/Models/grape_animations/walk.res index 40403e8..f2a0c4b 100644 Binary files a/godot/Models/grape_animations/walk.res and b/godot/Models/grape_animations/walk.res differ diff --git a/godot/Models/grape_man.glb b/godot/Models/grape_man.glb index df8336d..820471b 100644 --- a/godot/Models/grape_man.glb +++ b/godot/Models/grape_man.glb @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b5935dfd7a74d82cc011bea9fe5720a2ab9bbb2478a42001dc14822af6a4f833 -size 659376 +oid sha256:cf7fe79721dbc6b7468407aa104e0e04e3aeeedf9d3c57cc44b80c1887dbe0a4 +size 662408 diff --git a/godot/Models/rocks/rock_1.tscn b/godot/Models/rocks/rock_1.tscn index e9152dc..b09b71d 100644 --- a/godot/Models/rocks/rock_1.tscn +++ b/godot/Models/rocks/rock_1.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://g8vvg7c5ddkr"] [ext_resource type="PackedScene" uid="uid://djmky2hkbqcni" path="res://Models/rocks/rock1.glb" id="1_81161"] -[ext_resource type="Material" uid="uid://c5u3wq66dejxt" path="res://Textures/rock.tres" id="2_iyn5h"] +[ext_resource type="Material" path="res://Textures/rock.tres" id="2_iyn5h"] [node name="rock1" instance=ExtResource("1_81161")] diff --git a/godot/Player.gd b/godot/Player.gd index 82d396b..b6e2589 100644 --- a/godot/Player.gd +++ b/godot/Player.gd @@ -1,11 +1,13 @@ extends CharacterBody3D -const SPEED = 0.5 +const SPEED = 0.4 const JUMP_VELOCITY = 4.5 @export var horiz_sens = 0.25 @export var vert_sens = 0.25 +var LOWER_CAMERA_LIMIT = -60 +var UPPER_CAMERA_LIMIT = -11 var target: WeakRef = weakref(null) var holding: WeakRef = weakref(null) @@ -15,7 +17,7 @@ var gravity = ProjectSettings.get_setting("physics/3d/default_gravity") func _ready(): Input.mouse_mode = Input.MOUSE_MODE_CAPTURED - $CameraMount.global_rotation.x = clampf($CameraMount.global_rotation.x, deg_to_rad(-60), deg_to_rad(-11)) + $CameraMount.global_rotation.x = clampf($CameraMount.global_rotation.x, deg_to_rad(LOWER_CAMERA_LIMIT), deg_to_rad(UPPER_CAMERA_LIMIT)) func _process(_delta): @@ -27,6 +29,14 @@ func _process(_delta): if obj: obj.global_transform.origin = $grape_man.get_pickup_bone_location() + var event = Input.get_vector("camera_left", "camera_right", "camera_up", "camera_down") * 4 + + rotate_y(deg_to_rad(-event.x * horiz_sens)) + $CameraMount.rotate_x(deg_to_rad(-event.y * vert_sens)) + var roty = deg_to_rad(event.x * horiz_sens) + $grape_man.rotate_y(roty) + $CameraMount.global_rotation.x = clampf($CameraMount.global_rotation.x, deg_to_rad(LOWER_CAMERA_LIMIT), deg_to_rad(UPPER_CAMERA_LIMIT)) + func _input(event): # Handle the rotation of the camera using mouse movement. @@ -35,7 +45,9 @@ func _input(event): $CameraMount.rotate_x(deg_to_rad(-event.relative.y * vert_sens)) var roty = deg_to_rad(event.relative.x * horiz_sens) $grape_man.rotate_y(roty) - $CameraMount.global_rotation.x = clampf($CameraMount.global_rotation.x, deg_to_rad(-60), deg_to_rad(-11)) + $CameraMount.global_rotation.x = clampf($CameraMount.global_rotation.x, deg_to_rad(LOWER_CAMERA_LIMIT), deg_to_rad(UPPER_CAMERA_LIMIT)) + + if Input.is_action_just_pressed("ui_accept"): var obj = holding.get_ref() diff --git a/godot/Sounds/footstep.ogg b/godot/Sounds/footstep.ogg new file mode 100644 index 0000000..3935adb --- /dev/null +++ b/godot/Sounds/footstep.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91a1d193c7af76e861c0615d6b8ea221e065de2aa116f54ed06d55e0d6944a2b +size 7753 diff --git a/godot/Sounds/footstep.ogg.import b/godot/Sounds/footstep.ogg.import new file mode 100644 index 0000000..efa9e58 --- /dev/null +++ b/godot/Sounds/footstep.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://bmocmgq06o6f5" +path="res://.godot/imported/footstep.ogg-a3742943496340f7ceaa5ff03c6d5aa9.oggvorbisstr" + +[deps] + +source_file="res://Sounds/footstep.ogg" +dest_files=["res://.godot/imported/footstep.ogg-a3742943496340f7ceaa5ff03c6d5aa9.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/godot/cultist.gd b/godot/cultist.gd index 9e4afc6..552d37c 100644 --- a/godot/cultist.gd +++ b/godot/cultist.gd @@ -1,18 +1,24 @@ extends SharedSlime class_name Cultist -const SPEED = 5.0 -const JUMP_VELOCITY = 4. +var victim -func _on_area_3d_body_entered(body): - var items_in_range = $Area3D.get_overlapping_bodies() - var villagers = [] - - for item in items_in_range: - if is_class("Villager"): - villagers.append(item) - - var rng = RandomNumberGenerator.new() - var victim_num = rng.randi_range(0, villagers.size()) - +func _process(delta): + super._process(delta) + if task == "corrupt": + pass + + +# For corruption detection range. +func _on_target_radius_body_entered(body): + if body.is_class("Villager"): + victim = body + walk_speed = 2 * walk_speed + target_location_xz = victim.location_xz + task = "walk" + +# For collision with other slimes. +func _on_collision_detection_body_entered(body): + if body.is_class("Villager"): + task = "corrupt" diff --git a/godot/cultist.tscn b/godot/cultist.tscn index 409ecfc..af40605 100644 --- a/godot/cultist.tscn +++ b/godot/cultist.tscn @@ -1,31 +1,34 @@ -[gd_scene load_steps=7 format=3 uid="uid://e0s4phx2jiit"] +[gd_scene load_steps=6 format=3 uid="uid://e0s4phx2jiit"] [ext_resource type="Script" path="res://cultist.gd" id="1_k6djk"] -[ext_resource type="Texture2D" uid="uid://df0xror4t3gbc" path="res://Default Purple.png" id="1_x8j7f"] - -[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_y0hcm"] - -[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_vxnad"] -albedo_texture = ExtResource("1_x8j7f") - -[sub_resource type="CapsuleMesh" id="CapsuleMesh_17ljq"] -material = SubResource("StandardMaterial3D_vxnad") +[ext_resource type="PackedScene" uid="uid://c3q6fva1c1baa" path="res://Models/slime.tscn" id="2_004fn"] [sub_resource type="SphereShape3D" id="SphereShape3D_rypky"] -radius = 20.0 +radius = 5.0 + +[sub_resource type="SphereShape3D" id="SphereShape3D_pa038"] +radius = 3.0 + +[sub_resource type="SphereShape3D" id="SphereShape3D_bmc5i"] +radius = 0.3 [node name="Cultist" type="CharacterBody3D"] script = ExtResource("1_k6djk") -[node name="CollisionShape3D" type="CollisionShape3D" parent="."] -shape = SubResource("CapsuleShape3D_y0hcm") +[node name="TargetRadius" type="Area3D" parent="."] -[node name="MeshInstance3D" type="MeshInstance3D" parent="CollisionShape3D"] -mesh = SubResource("CapsuleMesh_17ljq") - -[node name="Area3D" type="Area3D" parent="."] - -[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="TargetRadius"] shape = SubResource("SphereShape3D_rypky") -[connection signal="body_entered" from="Area3D" to="." method="_on_area_3d_body_entered"] +[node name="slime" parent="." instance=ExtResource("2_004fn")] + +[node name="CollisionDetection" type="Area3D" parent="."] + +[node name="collision_ range" type="CollisionShape3D" parent="CollisionDetection"] +shape = SubResource("SphereShape3D_pa038") + +[node name="cultist_collision" type="CollisionShape3D" parent="."] +shape = SubResource("SphereShape3D_bmc5i") + +[connection signal="body_entered" from="TargetRadius" to="." method="_on_target_radius_body_entered"] +[connection signal="body_entered" from="CollisionDetection" to="." method="_on_collision_detection_body_entered"] diff --git a/godot/player.tscn b/godot/player.tscn index 3ee6e9e..4b969c4 100644 --- a/godot/player.tscn +++ b/godot/player.tscn @@ -21,10 +21,10 @@ shape = SubResource("CapsuleShape3D_kb4ms") [node name="grape_man" parent="." instance=ExtResource("2_ctyy5")] [node name="CameraMount" type="Node3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.3, 0) +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, 1.39043) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.643936) current = true fov = 50.0 diff --git a/godot/project.godot b/godot/project.godot index 3679929..d3345fa 100644 --- a/godot/project.godot +++ b/godot/project.godot @@ -56,7 +56,7 @@ ui_left={ "deadzone": 0.5, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194319,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null) -, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":-1.0,"script":null) , Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"echo":false,"script":null) ] } @@ -64,7 +64,7 @@ ui_right={ "deadzone": 0.5, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194321,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null) -, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":1.0,"script":null) , Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"echo":false,"script":null) ] } @@ -72,7 +72,7 @@ ui_up={ "deadzone": 0.5, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194320,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":false,"script":null) -, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":-1.0,"script":null) , Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"echo":false,"script":null) ] } @@ -80,7 +80,7 @@ ui_down={ "deadzone": 0.5, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194322,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null) -, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":1.0,"script":null) , Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"echo":false,"script":null) ] } @@ -97,3 +97,23 @@ Pause={ , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":6,"pressure":0.0,"pressed":false,"script":null) ] } +camera_up={ +"deadzone": 0.0, +"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":-1.0,"script":null) +] +} +camera_down={ +"deadzone": 0.0, +"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":1.0,"script":null) +] +} +camera_right={ +"deadzone": 0.0, +"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":2,"axis_value":1.0,"script":null) +] +} +camera_left={ +"deadzone": 0.0, +"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":2,"axis_value":-1.0,"script":null) +] +} diff --git a/godot/villager_shared.tscn b/godot/villager_shared.tscn index 94318fd..ca3dda5 100644 --- a/godot/villager_shared.tscn +++ b/godot/villager_shared.tscn @@ -1,17 +1,27 @@ -[gd_scene load_steps=4 format=3 uid="uid://c4s6y758n77lw"] +[gd_scene load_steps=5 format=3 uid="uid://c4s6y758n77lw"] [ext_resource type="PackedScene" uid="uid://dmtmign72vtlm" path="res://slime_shared.tscn" id="1_qm1jp"] [ext_resource type="Script" path="res://Villager.gd" id="2_uf6mh"] -[sub_resource type="SphereShape3D" id="SphereShape3D_0wi6w"] +[sub_resource type="SphereShape3D" id="SphereShape3D_k5rhc"] +radius = 0.05 + +[sub_resource type="SphereShape3D" id="SphereShape3D_wx128"] radius = 0.1 [node name="villager" instance=ExtResource("1_qm1jp")] script = ExtResource("2_uf6mh") -[node name="Area3D" type="Area3D" parent="." index="2"] +[node name="CollisionDetection" type="Area3D" parent="." index="2"] + +[node name="slime_collision" type="CollisionShape3D" parent="CollisionDetection" index="0"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0408143, 0) +shape = SubResource("SphereShape3D_k5rhc") + +[node name="Area3D" type="Area3D" parent="." index="3"] [node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D" index="0"] -shape = SubResource("SphereShape3D_0wi6w") +shape = SubResource("SphereShape3D_wx128") +[connection signal="body_entered" from="CollisionDetection" to="." method="_on_collision_detection_body_entered"] [connection signal="body_entered" from="Area3D" to="." method="_on_area_3d_body_entered"]