initial experiments
This commit is contained in:
commit
c90da1eda2
17 changed files with 259 additions and 0 deletions
4
.editorconfig
Normal file
4
.editorconfig
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# Normalize EOL for all files that Git considers text files.
|
||||||
|
* text=auto eol=lf
|
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# Godot 4+ specific ignores
|
||||||
|
.godot/
|
||||||
|
/android/
|
7
assets/levels/test_level/Cliffs.tres
Normal file
7
assets/levels/test_level/Cliffs.tres
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
[gd_resource type="StandardMaterial3D" format=3 uid="uid://bse18s1snidh4"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
resource_name = "Cliffs"
|
||||||
|
cull_mode = 2
|
||||||
|
albedo_color = Color(0.906332, 0.906332, 0.906332, 1)
|
||||||
|
roughness = 0.5
|
BIN
assets/levels/test_level/test_level.blend
Normal file
BIN
assets/levels/test_level/test_level.blend
Normal file
Binary file not shown.
BIN
assets/levels/test_level/test_level.blend1
Normal file
BIN
assets/levels/test_level/test_level.blend1
Normal file
Binary file not shown.
BIN
assets/levels/test_level/test_level.glb
Normal file
BIN
assets/levels/test_level/test_level.glb
Normal file
Binary file not shown.
44
assets/levels/test_level/test_level.glb.import
Normal file
44
assets/levels/test_level/test_level.glb.import
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="scene"
|
||||||
|
importer_version=1
|
||||||
|
type="PackedScene"
|
||||||
|
uid="uid://bw3pwwp5iqwfi"
|
||||||
|
path="res://.godot/imported/test_level.glb-8c974807ad516a5888d2ebb9918fb9d4.scn"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/levels/test_level/test_level.glb"
|
||||||
|
dest_files=["res://.godot/imported/test_level.glb-8c974807ad516a5888d2ebb9918fb9d4.scn"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
nodes/root_type=""
|
||||||
|
nodes/root_name=""
|
||||||
|
nodes/apply_root_scale=true
|
||||||
|
nodes/root_scale=1.0
|
||||||
|
nodes/import_as_skeleton_bones=false
|
||||||
|
nodes/use_node_type_suffixes=true
|
||||||
|
meshes/ensure_tangents=true
|
||||||
|
meshes/generate_lods=true
|
||||||
|
meshes/create_shadow_meshes=true
|
||||||
|
meshes/light_baking=1
|
||||||
|
meshes/lightmap_texel_size=0.2
|
||||||
|
meshes/force_disable_compression=false
|
||||||
|
skins/use_named_skins=true
|
||||||
|
animation/import=true
|
||||||
|
animation/fps=30
|
||||||
|
animation/trimming=false
|
||||||
|
animation/remove_immutable_tracks=true
|
||||||
|
animation/import_rest_as_RESET=false
|
||||||
|
import_script/path=""
|
||||||
|
_subresources={
|
||||||
|
"materials": {
|
||||||
|
"Cliffs": {
|
||||||
|
"use_external/enabled": true,
|
||||||
|
"use_external/path": "res://assets/levels/test_level/Cliffs.tres"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
gltf/naming_version=1
|
||||||
|
gltf/embedded_image_handling=1
|
BIN
assets/textures/sg_idle_color.png
Normal file
BIN
assets/textures/sg_idle_color.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 288 B |
34
assets/textures/sg_idle_color.png.import
Normal file
34
assets/textures/sg_idle_color.png.import
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://befg6ydw61eov"
|
||||||
|
path="res://.godot/imported/sg_idle_color.png-bab58dade3f7ce6882f810c067f83831.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/textures/sg_idle_color.png"
|
||||||
|
dest_files=["res://.godot/imported/sg_idle_color.png-bab58dade3f7ce6882f810c067f83831.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=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
|
1
icon.svg
Normal file
1
icon.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg>
|
After Width: | Height: | Size: 994 B |
37
icon.svg.import
Normal file
37
icon.svg.import
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://bluus5ymkdsg"
|
||||||
|
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
|
23
levels/test_level.tscn
Normal file
23
levels/test_level.tscn
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
[gd_scene load_steps=4 format=3 uid="uid://cnwgryo1nj2a1"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bw3pwwp5iqwfi" path="res://assets/levels/test_level/test_level.glb" id="1_46lwt"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bquyryhfcp8y7" path="res://objects/player/player.tscn" id="2_x25rp"]
|
||||||
|
|
||||||
|
[sub_resource type="Curve3D" id="Curve3D_46lwt"]
|
||||||
|
_data = {
|
||||||
|
"points": PackedVector3Array(-1.26348, 0, -0.203417, 1.26348, 0, 0.203417, -6.88307, 0, -0.894118, -1.50946, 0, 0.585966, 1.50946, 0, -0.585966, 4.42538, 0, -0.129086, -0.680172, 0, 1.36703, 0.680172, 0, -1.36703, 6.9523, 0, -2.57396, 0.22647, 0, 1.7587, -0.22647, 0, -1.7587, 8.27033, 0, -8.20324, 0.571661, 0, 0.487944, -0.571661, 0, -0.487944, 6.64078, 0, -11.6749, 1.24906, 0, 0.0725613, -1.24906, 0, -0.0725613, 2.74404, 0, -13.021, 1.32889, 0, -0.529663, -1.32889, 0, 0.529663, -2.28629, 0, -12.4188, 0.806547, 0, -1.2679, -0.806547, 0, 1.2679, -6.50186, 0, -8.94716, 0.106077, 0, -1.74292, -0.106077, 0, 1.74292, -7.45833, 0, -4.87329, -0.271801, 0, -1.92385, 0.271801, 0, 1.92385, -7.24578, 0, 0.12162, -1.13926, 0, -2.82601, 1.13926, 0, 2.82601, -5.43911, 0, 6.53353, -2.63552, 0, -2.76206, 2.63552, 0, 2.76206, -1.05201, 0, 12.4522, -1.67377, 0, -0.91955, 1.67377, 0, 0.91955, 2.95101, 0, 16.0656, -2.65928, 0, 0.0071373, 2.65928, 0, -0.0071373, 9.15037, 0, 16.8803, 0, 0, 0, 0, 0, 0, 28.9123, 0, 16.2836),
|
||||||
|
"tilts": PackedFloat32Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
|
||||||
|
}
|
||||||
|
point_count = 15
|
||||||
|
|
||||||
|
[node name="TestLevel" instance=ExtResource("1_46lwt")]
|
||||||
|
|
||||||
|
[node name="Path3D" type="Path3D" parent="." index="1"]
|
||||||
|
curve = SubResource("Curve3D_46lwt")
|
||||||
|
|
||||||
|
[node name="Player" parent="." index="2" node_paths=PackedStringArray("level_path") instance=ExtResource("2_x25rp")]
|
||||||
|
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 1.88228, 0)
|
||||||
|
level_path = NodePath("../Path3D")
|
||||||
|
|
||||||
|
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="." index="3"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 0.464162, 0.88575, 0, -0.88575, 0.464162, 0, 10.1106, 0)
|
30
objects/player/player.gd
Normal file
30
objects/player/player.gd
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
extends CharacterBody3D
|
||||||
|
|
||||||
|
|
||||||
|
@export var walk_speed: float
|
||||||
|
@export var gravity: float
|
||||||
|
@export var jump_force: float
|
||||||
|
|
||||||
|
@export var level_path: Path3D
|
||||||
|
|
||||||
|
|
||||||
|
func _physics_process(delta: float) -> void:
|
||||||
|
# snap player horizontally to path
|
||||||
|
var path_offset = level_path.curve.get_closest_offset(level_path.to_local(global_position))
|
||||||
|
var path_trans = level_path.curve.sample_baked_with_rotation(path_offset, true)
|
||||||
|
global_position.x = path_trans.origin.x
|
||||||
|
global_position.z = path_trans.origin.z
|
||||||
|
global_transform.basis.x = -path_trans.basis.x
|
||||||
|
global_transform.basis.z = -path_trans.basis.z
|
||||||
|
|
||||||
|
# horizontal movement
|
||||||
|
var h_movement = global_transform.basis.z * Input.get_axis(&"walk_left", &"walk_right") * walk_speed
|
||||||
|
velocity.x = h_movement.x
|
||||||
|
velocity.z = h_movement.z
|
||||||
|
|
||||||
|
# vertical movement
|
||||||
|
velocity.y -= gravity * delta
|
||||||
|
if Input.is_action_just_pressed(&"jump"):
|
||||||
|
velocity.y = jump_force
|
||||||
|
|
||||||
|
move_and_slide()
|
1
objects/player/player.gd.uid
Normal file
1
objects/player/player.gd.uid
Normal file
|
@ -0,0 +1 @@
|
||||||
|
uid://daswmtow3mr37
|
29
objects/player/player.tscn
Normal file
29
objects/player/player.tscn
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
[gd_scene load_steps=4 format=3 uid="uid://bquyryhfcp8y7"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://befg6ydw61eov" path="res://assets/textures/sg_idle_color.png" id="1_cqmt1"]
|
||||||
|
[ext_resource type="Script" uid="uid://daswmtow3mr37" path="res://objects/player/player.gd" id="1_g7ett"]
|
||||||
|
|
||||||
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_ssrue"]
|
||||||
|
height = 1.0
|
||||||
|
radius = 0.25
|
||||||
|
|
||||||
|
[node name="Player" type="CharacterBody3D"]
|
||||||
|
script = ExtResource("1_g7ett")
|
||||||
|
walk_speed = 6.0
|
||||||
|
gravity = 15.0
|
||||||
|
jump_force = 8.0
|
||||||
|
|
||||||
|
[node name="Sprite3D" type="Sprite3D" parent="."]
|
||||||
|
offset = Vector2(0, 9)
|
||||||
|
flip_h = true
|
||||||
|
pixel_size = 0.0556
|
||||||
|
axis = 0
|
||||||
|
texture_filter = 0
|
||||||
|
texture = ExtResource("1_cqmt1")
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||||
|
shape = SubResource("CylinderShape3D_ssrue")
|
||||||
|
|
||||||
|
[node name="Camera3D" type="Camera3D" parent="."]
|
||||||
|
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -5, 1.5, 0)
|
44
project.godot
Normal file
44
project.godot
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
; 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="Revolution 3064"
|
||||||
|
run/main_scene="uid://cnwgryo1nj2a1"
|
||||||
|
config/features=PackedStringArray("4.4", "GL Compatibility")
|
||||||
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
|
[filesystem]
|
||||||
|
|
||||||
|
import/blender/enabled=false
|
||||||
|
|
||||||
|
[input]
|
||||||
|
|
||||||
|
walk_left={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"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":4194319,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
walk_right={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"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":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
jump={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"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":90,"key_label":0,"unicode":122,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
[rendering]
|
||||||
|
|
||||||
|
textures/canvas_textures/default_texture_filter=0
|
||||||
|
renderer/rendering_method="gl_compatibility"
|
||||||
|
renderer/rendering_method.mobile="gl_compatibility"
|
Loading…
Add table
Add a link
Reference in a new issue