From d13e420c1a6eaa3167d6c7b401a25530942eb425 Mon Sep 17 00:00:00 2001 From: Riley Winkler Date: Thu, 13 Feb 2025 00:57:06 -0600 Subject: [PATCH] Initial Commit --- .gitattributes | 2 ++ .gitignore | 3 +++ Character.tscn | 18 ++++++++++++++ character.gd | 35 +++++++++++++++++++++++++++ icon.svg | 1 + icon.svg.import | 37 +++++++++++++++++++++++++++++ lake.tscn | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ project.godot | 20 ++++++++++++++++ 8 files changed, 179 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 Character.tscn create mode 100644 character.gd create mode 100644 icon.svg create mode 100644 icon.svg.import create mode 100644 lake.tscn create mode 100644 project.godot diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0af181c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Godot 4+ specific ignores +.godot/ +/android/ diff --git a/Character.tscn b/Character.tscn new file mode 100644 index 0000000..3190937 --- /dev/null +++ b/Character.tscn @@ -0,0 +1,18 @@ +[gd_scene load_steps=4 format=3 uid="uid://cu1bnkqxd1nyh"] + +[ext_resource type="Script" path="res://character.gd" id="1_32tgv"] + +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_4w3u7"] + +[sub_resource type="CapsuleMesh" id="CapsuleMesh_2wqp7"] + +[node name="Character" type="CharacterBody3D"] +script = ExtResource("1_32tgv") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +shape = SubResource("CapsuleShape3D_4w3u7") + +[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."] + +[node name="MeshInstance3D" type="MeshInstance3D" parent="."] +mesh = SubResource("CapsuleMesh_2wqp7") diff --git a/character.gd b/character.gd new file mode 100644 index 0000000..95925b2 --- /dev/null +++ b/character.gd @@ -0,0 +1,35 @@ +extends CharacterBody3D + +var movement_speed: float = 2.0 +var movement_target_position: Vector3 = Vector3(-3.0,0.0,3.5) + +@onready var navigation_agent: NavigationAgent3D = $NavigationAgent3D + +func _ready(): + # These values need to be adjusted for the actor's speed + # and the navigation layout. + navigation_agent.path_desired_distance = 0.5 + navigation_agent.target_desired_distance = 0.75 + + # Make sure to not await during _ready. + actor_setup.call_deferred() + +func actor_setup(): + # Wait for the first physics frame so the NavigationServer can sync. + await get_tree().physics_frame + + # Now that the navigation map is no longer empty, set the movement target. + set_movement_target(movement_target_position) + +func set_movement_target(movement_target: Vector3): + navigation_agent.set_target_position(movement_target) + +func _physics_process(delta): + if navigation_agent.is_navigation_finished(): + return + + var current_agent_position: Vector3 = global_position + var next_path_position: Vector3 = navigation_agent.get_next_path_position() + + velocity = current_agent_position.direction_to(next_path_position) * movement_speed + move_and_slide() diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..9d8b7fa --- /dev/null +++ b/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icon.svg.import b/icon.svg.import new file mode 100644 index 0000000..fdba84d --- /dev/null +++ b/icon.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c461u1k5nnc3e" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +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=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/lake.tscn b/lake.tscn new file mode 100644 index 0000000..7bd73bb --- /dev/null +++ b/lake.tscn @@ -0,0 +1,63 @@ +[gd_scene load_steps=3 format=3 uid="uid://b5i2qmhgqp617"] + +[sub_resource type="NavigationMesh" id="NavigationMesh_nu02n"] +vertices = PackedVector3Array(-49.5, 2, -39.8369, -19.75, 2, -39.5869, -19.5, 2, -41.8369, -18.75, 2, -42.5869, -10.5, 2, -47.8369, -10.5, 2, -94.8369, -49.5, 2, -94.8369, -8.5, 2, -47.5869, -8.25, 2, -94.8369, -3.25, 2, -46.5869, -3, 2, -94.8369, 2, 2, -45.5869, 2.25, 2, -94.8369, 7.25, 2, -44.5869, 7.5, 2, -94.8369, 25.25, 2, -29.3369, 25.25, 2, -27.8369, 49.5, 2, -28.0869, 10.5, 2, -44.0869, 49.5, 2, -94.8369, -20.5, 2, -28.3369, -49.5, 2, -28.3369, -21.5, 2, -15.5869, -49.5, 2, -15.5869, 26.25, 2, -21.0869, 49.5, 2, -21.3369, 27.25, 2, -13.3369, 49.5, 2, -13.5869, -21.5, 2, -14.0869, -13.5, 2, -1.08691, -12.25, 2, -0.0869141, -49.5, 2, 49.4131, -4, 2, 49.4131, -3.75, 2, 2.66309, -6, 2, 2.41309, 27.75, 2, -9.83691, 27.5, 2, -7.83691, 49.5, 2, -7.83691, 23, 2, 1.41309, 20.5, 2, 2.66309, 19.25, 2, 49.4131, 49.5, 2, 49.4131, 19, 2, 2.66309) +polygons = [PackedInt32Array(2, 1, 0), PackedInt32Array(3, 2, 0), PackedInt32Array(3, 0, 4), PackedInt32Array(4, 0, 5), PackedInt32Array(5, 0, 6), PackedInt32Array(5, 8, 4), PackedInt32Array(4, 8, 7), PackedInt32Array(8, 10, 7), PackedInt32Array(7, 10, 9), PackedInt32Array(10, 12, 9), PackedInt32Array(9, 12, 11), PackedInt32Array(12, 14, 11), PackedInt32Array(11, 14, 13), PackedInt32Array(17, 16, 15), PackedInt32Array(15, 18, 17), PackedInt32Array(17, 18, 14), PackedInt32Array(17, 14, 19), PackedInt32Array(13, 14, 18), PackedInt32Array(21, 0, 20), PackedInt32Array(20, 0, 1), PackedInt32Array(23, 21, 22), PackedInt32Array(22, 21, 20), PackedInt32Array(25, 24, 17), PackedInt32Array(17, 24, 16), PackedInt32Array(27, 26, 25), PackedInt32Array(25, 26, 24), PackedInt32Array(23, 22, 28), PackedInt32Array(23, 28, 29), PackedInt32Array(29, 30, 23), PackedInt32Array(23, 30, 31), PackedInt32Array(31, 30, 32), PackedInt32Array(32, 34, 33), PackedInt32Array(32, 30, 34), PackedInt32Array(37, 36, 35), PackedInt32Array(26, 27, 35), PackedInt32Array(35, 27, 37), PackedInt32Array(38, 36, 37), PackedInt32Array(38, 37, 39), PackedInt32Array(39, 37, 40), PackedInt32Array(40, 37, 41), PackedInt32Array(40, 42, 39), PackedInt32Array(33, 42, 32), PackedInt32Array(32, 42, 40)] + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_mmd0r"] +albedo_color = Color(0.0853566, 0.29, 0.0783, 1) + +[node name="Lake" type="Node3D"] + +[node name="NavigationRegion3D" type="NavigationRegion3D" parent="."] +navigation_mesh = SubResource("NavigationMesh_nu02n") + +[node name="Level" type="CSGCombiner3D" parent="NavigationRegion3D"] + +[node name="CSGBox3D" type="CSGBox3D" parent="NavigationRegion3D/Level"] +transform = Transform3D(100, 0, 0, 0, 3, 0, 0, 0, 100, 0, 0, -22.6685) +size = Vector3(1, 1, 1.45337) +material = SubResource("StandardMaterial3D_mmd0r") + +[node name="LakeArea" type="CSGCombiner3D" parent="NavigationRegion3D/Level"] +operation = 2 + +[node name="CSGBox3D" type="CSGBox3D" parent="NavigationRegion3D/Level/LakeArea"] +transform = Transform3D(8.96721, 0, 0, 0, 5.63, 0, 0, 0, 4.82575, 7.63805, 0, -4.49351) +size = Vector3(2.70355, 1, 2.8623) + +[node name="CSGBox3D2" type="CSGBox3D" parent="NavigationRegion3D/Level/LakeArea"] +transform = Transform3D(8.3338, 0, -1.78149, 0, 5.63, 0, 3.31036, 0, 4.48488, -6.32943, 0, -5.02246) +size = Vector3(1, 1, 2.5874) + +[node name="CSGBox3D3" type="CSGBox3D" parent="NavigationRegion3D/Level/LakeArea"] +transform = Transform3D(4.69402, 0, -4.11177, 0, 5.63, 0, 7.64048, 0, 2.52611, -10.3268, 9.53674e-07, -11.8459) +size = Vector3(1.78711, 1, 3.23682) + +[node name="CSGBox3D4" type="CSGBox3D" parent="NavigationRegion3D/Level/LakeArea"] +transform = Transform3D(-0.68499, 0, -4.81165, 0, 5.63, 0, 8.941, 0, -0.368631, -10.2995, 9.53674e-07, -27.4584) +size = Vector3(3.03076, 1, 4.09277) + +[node name="CSGBox3D5" type="CSGBox3D" parent="NavigationRegion3D/Level/LakeArea"] +transform = Transform3D(-7.48565, 0, -2.65698, 0, 5.63, 0, 4.93719, 0, -4.02844, -10.8011, 9.53674e-07, -38.7966) +size = Vector3(1.18384, 1, 2.89941) + +[node name="CSGBox3D6" type="CSGBox3D" parent="NavigationRegion3D/Level/LakeArea"] +transform = Transform3D(-8.80802, 0, 0.905248, 0, 5.63, 0, -1.68213, 0, -4.74008, -1.97462, 9.53674e-07, -34.7349) +size = Vector3(2.31555, 1, 4.58154) + +[node name="CSGBox3D7" type="CSGBox3D" parent="NavigationRegion3D/Level/LakeArea"] +transform = Transform3D(-6.36342, 0, 3.40009, 0, 5.63, 0, -6.31804, 0, -3.42451, 5.90479, 9.53674e-07, -24.6551) +size = Vector3(2.31555, 1, 6.84082) + +[node name="CSGBox3D8" type="CSGBox3D" parent="NavigationRegion3D/Level/LakeArea"] +transform = Transform3D(-1.14438, 0, 4.78629, 0, 5.63, 0, -8.89388, 0, -0.615856, 17.7987, 9.53674e-07, -17.7252) +size = Vector3(2.31555, 1, 3.4624) + +[node name="CSGBox3D9" type="CSGBox3D" parent="NavigationRegion3D/Level/LakeArea"] +transform = Transform3D(3.87164, 0, 4.35278, 0, 5.63, 0, -8.08834, 0, 2.08354, 13.9638, 9.53674e-07, -8.95581) +size = Vector3(1.23151, 1, 5.03125) + +[node name="CSGBox3D10" type="CSGBox3D" parent="NavigationRegion3D/Level/LakeArea"] +transform = Transform3D(8.28348, 0, 1.84821, 0, 5.63, 0, -3.43435, 0, 4.4578, 20.2467, 9.53674e-07, -0.416638) +size = Vector3(0.334114, 1, 1) diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..b976845 --- /dev/null +++ b/project.godot @@ -0,0 +1,20 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="Helios Discord App" +config/features=PackedStringArray("4.3", "GL Compatibility") +config/icon="res://icon.svg" + +[rendering] + +renderer/rendering_method="gl_compatibility" +renderer/rendering_method.mobile="gl_compatibility"