initial commit

This commit is contained in:
Jonas Weinz 2022-08-10 17:13:51 +02:00
parent 2031322ea8
commit 1edbdc3dea
12 changed files with 203 additions and 0 deletions

2
puzzle/.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf

2
puzzle/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
# Godot 4+ specific ignores
.godot/

BIN
puzzle/blender/robot.blend Normal file

Binary file not shown.

BIN
puzzle/blender/robot.blend1 Normal file

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://dq5l464evyked"
path="res://.godot/imported/test_ground.blend-425b9d15a7f14925d8000121d5e07be2.scn"
[deps]
source_file="res://blender/test_ground.blend"
dest_files=["res://.godot/imported/test_ground.blend-425b9d15a7f14925d8000121d5e07be2.scn"]
[params]
nodes/root_type="Node3D"
nodes/root_name="Scene Root"
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
import_script/path=""
_subresources={}
blender/nodes/visible=2
blender/nodes/punctual_lights=true
blender/nodes/cameras=true
blender/nodes/custom_properties=true
blender/nodes/modifiers=1
blender/meshes/colors=false
blender/meshes/uvs=true
blender/meshes/normals=true
blender/meshes/tangents=true
blender/meshes/skins=2
blender/meshes/export_bones_deforming_mesh_only=false
blender/materials/unpack_enabled=true
blender/materials/export_materials=1
blender/animation/limit_playback=true
blender/animation/always_sample=true
blender/animation/group_tracks=true

BIN
puzzle/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

34
puzzle/icon.png.import Normal file
View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c36sjnmwj406w"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.png"
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
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

48
puzzle/map.tscn Normal file
View File

@ -0,0 +1,48 @@
[gd_scene load_steps=8 format=3 uid="uid://cuohiydexf5n"]
[ext_resource type="PackedScene" uid="uid://c4ye4j37eiuhb" path="res://test_ground.tscn" id="1_p7ywp"]
[ext_resource type="Script" path="res://player.gd" id="2_f4o04"]
[sub_resource type="PhysicalSkyMaterial" id="PhysicalSkyMaterial_mh53i"]
[sub_resource type="Sky" id="Sky_fu4y1"]
sky_material = SubResource("PhysicalSkyMaterial_mh53i")
[sub_resource type="Environment" id="Environment_lamky"]
background_mode = 2
background_color = Color(0, 0.611765, 0.533333, 1)
sky = SubResource("Sky_fu4y1")
sky_custom_fov = 1.2
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_t1cxb"]
albedo_color = Color(0.0862745, 0.470588, 0.839216, 1)
[sub_resource type="SphereShape3D" id="SphereShape3D_sjmr4"]
[node name="Node3D" type="Node3D"]
[node name="test_ground" parent="." instance=ExtResource("1_p7ywp")]
transform = Transform3D(0.9994, -0.0346379, 0, 0.0346379, 0.9994, 0, 0, 0, 1, -1.52052, -9.32694, -0.309357)
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(0.00469292, -0.310288, 0.950631, -0.0542184, 0.949164, 0.310077, -0.998518, -0.0529968, -0.0123689, 80.7546, 36.3879, 1.88406)
environment = SubResource("Environment_lamky")
current = true
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(0.0657009, 0.989589, 0.12805, 0.676529, -0.138506, 0.723274, 0.73348, 0.0391095, -0.678585, 21.9756, 11.6848, 1.12691)
light_energy = 0.41
light_angular_distance = 8.26
[node name="player" type="CharacterBody3D" parent="."]
script = ExtResource("2_f4o04")
[node name="CSGSphere3D" type="CSGSphere3D" parent="player"]
radius = 2.0
radial_segments = 30
rings = 18
material = SubResource("StandardMaterial3D_t1cxb")
[node name="CollisionShape3D" type="CollisionShape3D" parent="player"]
transform = Transform3D(4, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0)
shape = SubResource("SphereShape3D_sjmr4")

31
puzzle/player.gd Normal file
View File

@ -0,0 +1,31 @@
extends CharacterBody3D
const SPEED = 5.0
const JUMP_VELOCITY = 4.5
# Get the gravity from the project settings to be synced with RigidDynamicBody nodes.
var gravity = ProjectSettings.get_setting("physics/3d/default_gravity")
func _physics_process(delta):
# Add the gravity.
if not is_on_floor():
velocity.y -= gravity * delta
# Handle Jump.
if Input.is_action_just_pressed("ui_accept") and is_on_floor():
velocity.y = JUMP_VELOCITY
# Get the input direction and handle the movement/deceleration.
# As good practice, you should replace UI actions with custom gameplay actions.
var input_dir = Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down")
var direction = (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
if direction:
velocity.x = direction.x * SPEED
velocity.z = direction.z * SPEED
else:
velocity.x = move_toward(velocity.x, 0, SPEED)
velocity.z = move_toward(velocity.z, 0, SPEED)
move_and_slide()

16
puzzle/project.godot Normal file
View File

@ -0,0 +1,16 @@
; 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="Puzzle"
run/main_scene="res://map.tscn"
config/features=PackedStringArray("4.0", "Vulkan Clustered")
config/icon="res://icon.png"

26
puzzle/test_ground.tscn Normal file

File diff suppressed because one or more lines are too long