Basic movement demo

This commit is contained in:
2023-09-02 00:55:35 -07:00
parent 9dac81407b
commit 955f9d307c
22 changed files with 3286 additions and 1 deletions

6
GameJam2023.csproj Normal file
View File

@@ -0,0 +1,6 @@
<Project Sdk="Godot.NET.Sdk/4.1.1">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading>
</PropertyGroup>
</Project>

19
GameJam2023.sln Normal file
View File

@@ -0,0 +1,19 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GameJam2023", "GameJam2023.csproj", "{3B4A9BC2-CE18-43D8-86F2-32E21A4BEAA2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
ExportDebug|Any CPU = ExportDebug|Any CPU
ExportRelease|Any CPU = ExportRelease|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3B4A9BC2-CE18-43D8-86F2-32E21A4BEAA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B4A9BC2-CE18-43D8-86F2-32E21A4BEAA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B4A9BC2-CE18-43D8-86F2-32E21A4BEAA2}.ExportDebug|Any CPU.ActiveCfg = ExportDebug|Any CPU
{3B4A9BC2-CE18-43D8-86F2-32E21A4BEAA2}.ExportDebug|Any CPU.Build.0 = ExportDebug|Any CPU
{3B4A9BC2-CE18-43D8-86F2-32E21A4BEAA2}.ExportRelease|Any CPU.ActiveCfg = ExportRelease|Any CPU
{3B4A9BC2-CE18-43D8-86F2-32E21A4BEAA2}.ExportRelease|Any CPU.Build.0 = ExportRelease|Any CPU
EndGlobalSection
EndGlobal

2870
Models/TestModels/link.gltf Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,32 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://dtyujwnb6w3kv"
path="res://.godot/imported/link.gltf-b81237b90524775660928cafe940903d.scn"
[deps]
source_file="res://Models/TestModels/link.gltf"
dest_files=["res://.godot/imported/link.gltf-b81237b90524775660928cafe940903d.scn"]
[params]
nodes/root_type="Node3D"
nodes/root_name="Scene Root"
nodes/apply_root_scale=true
nodes/root_scale=1.0
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/embedded_image_handling=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

View File

@@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cp8bxedhoqdqa"
path.s3tc="res://.godot/imported/link_MI_body_alb.png-57b8628ae8b879ccf189bbad5b09653d.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}
[deps]
source_file="res://Models/TestModels/link_MI_body_alb.png"
dest_files=["res://.godot/imported/link_MI_body_alb.png-57b8628ae8b879ccf189bbad5b09653d.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ubtk0ki6dlvn"
path.s3tc="res://.godot/imported/link_MI_ear_alb.png-8a118b9cbabd4d9aed2bad2915ec0747.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}
[deps]
source_file="res://Models/TestModels/link_MI_ear_alb.png"
dest_files=["res://.godot/imported/link_MI_ear_alb.png-8a118b9cbabd4d9aed2bad2915ec0747.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dmak1d8jxiwkf"
path.s3tc="res://.godot/imported/link_MI_eye_alb.png-8684be71406be5e68cbc137e0a8da8d2.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}
[deps]
source_file="res://Models/TestModels/link_MI_eye_alb.png"
dest_files=["res://.godot/imported/link_MI_eye_alb.png-8684be71406be5e68cbc137e0a8da8d2.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://r5sixodlmol"
path.s3tc="res://.godot/imported/link_MI_hair_alb.png-75ffa4a4438bb199e93140a7523d4a05.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}
[deps]
source_file="res://Models/TestModels/link_MI_hair_alb.png"
dest_files=["res://.godot/imported/link_MI_hair_alb.png-75ffa4a4438bb199e93140a7523d4a05.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://w86lelyia6lk"
path.s3tc="res://.godot/imported/link_MI_mouth_alb.png-92cc01b15fe3748aba59efd639ce1342.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}
[deps]
source_file="res://Models/TestModels/link_MI_mouth_alb.png"
dest_files=["res://.godot/imported/link_MI_mouth_alb.png-92cc01b15fe3748aba59efd639ce1342.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

View File

@@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ckbry1lnmqdhr"
path.s3tc="res://.godot/imported/link_MI_shieldA_alb.png-f96a051c801b6600fab39498fba8dad2.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}
[deps]
source_file="res://Models/TestModels/link_MI_shieldA_alb.png"
dest_files=["res://.godot/imported/link_MI_shieldA_alb.png-f96a051c801b6600fab39498fba8dad2.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cj7uc13601inf"
path.s3tc="res://.godot/imported/link_MI_sowrdA_alb.png-9198c16c60b055fe820b6d002707e41e.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}
[deps]
source_file="res://Models/TestModels/link_MI_sowrdA_alb.png"
dest_files=["res://.godot/imported/link_MI_sowrdA_alb.png-9198c16c60b055fe820b6d002707e41e.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

21
Scenes/TestCharacter.tscn Normal file
View File

@@ -0,0 +1,21 @@
[gd_scene load_steps=4 format=3 uid="uid://b38hcomu4tpm5"]
[ext_resource type="Script" path="res://Scripts/TestCharacter.cs" id="1_hddqi"]
[ext_resource type="PackedScene" uid="uid://dtyujwnb6w3kv" path="res://Models/TestModels/link.gltf" id="1_rwdbt"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_fqik1"]
radius = 0.152487
height = 0.456443
[node name="Character" type="CharacterBody3D"]
script = ExtResource("1_hddqi")
_speed = 2.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(0.999665, -0.0258978, -7.10543e-15, 0.0258978, 0.999665, 0, 0, 0, 1, 0, 0.19703, 0)
shape = SubResource("CapsuleShape3D_fqik1")
[node name="Pivot" type="Node3D" parent="."]
[node name="link" parent="Pivot" instance=ExtResource("1_rwdbt")]
transform = Transform3D(-10, 0, 8.74228e-07, 0, 10, 0, -8.74228e-07, 0, -10, 0, 0, 0)

29
Scenes/TestLevel.tscn Normal file
View File

@@ -0,0 +1,29 @@
[gd_scene load_steps=4 format=3 uid="uid://dy3d4e6qegyjg"]
[ext_resource type="PackedScene" uid="uid://b38hcomu4tpm5" path="res://Scenes/TestCharacter.tscn" id="1_fwf6c"]
[sub_resource type="BoxShape3D" id="BoxShape3D_dk0pn"]
size = Vector3(100, 1, 100)
[sub_resource type="BoxMesh" id="BoxMesh_eaper"]
size = Vector3(100, 1, 100)
[node name="Level" type="Node3D"]
[node name="StaticBody3D" type="StaticBody3D" parent="."]
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D"]
shape = SubResource("BoxShape3D_dk0pn")
[node name="MeshInstance3D" type="MeshInstance3D" parent="StaticBody3D"]
mesh = SubResource("BoxMesh_eaper")
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, -0.118128, 5.82113, -1.13346)
fov = 40.0
[node name="Link" parent="." instance=ExtResource("1_fwf6c")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.931845, -0.0850834, 0.35274, -0.0909281, 0.995857, -1.47234e-08, -0.351279, -0.032074, -0.935721, -3.58319, 8.01249, 0.163277)

32
Scripts/TestCharacter.cs Normal file
View File

@@ -0,0 +1,32 @@
using Godot;
using System;
public partial class TestCharacter : CharacterBody3D
{
[Export]
private float _speed = 5.0f;
public override void _PhysicsProcess(double delta)
{
Vector3 velocity = Velocity;
// Get the input direction and handle the movement/deceleration.
// As good practice, you should replace UI actions with custom gameplay actions.
Vector2 inputDir = Input.GetVector("p1_left", "p1_right", "p1_up", "p1_down");
Vector3 direction = (Transform.Basis * new Vector3(inputDir.X, 0, inputDir.Y)).Normalized();
if (direction != Vector3.Zero)
{
velocity.X = direction.X * _speed;
velocity.Z = direction.Z * _speed;
GetNode<Node3D>("Pivot").LookAt(Position + direction, Vector3.Up);
}
else
{
velocity.X = Mathf.MoveToward(Velocity.X, 0, _speed);
velocity.Z = Mathf.MoveToward(Velocity.Z, 0, _speed);
}
Velocity = velocity;
MoveAndSlide();
}
}

View File

@@ -11,8 +11,32 @@ config_version=5
[application]
config/name="GameJam2023"
config/features=PackedStringArray("4.1", "Forward Plus")
run/main_scene="res://Scenes/TestLevel.tscn"
config/features=PackedStringArray("4.1", "C#", "Forward Plus")
[dotnet]
project/assembly_name="GameJam2023"
[input]
p1_up={
"deadzone": 0.5,
"events": [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)
]
}
p1_left={
"deadzone": 0.5,
"events": [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)
]
}
p1_right={
"deadzone": 0.5,
"events": [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)
]
}
p1_down={
"deadzone": 0.5,
"events": [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)
]
}