Loads of stuff

This commit is contained in:
Dan Baker 2025-06-23 19:39:55 +01:00
parent f3af522683
commit 66ce3ff503
413 changed files with 14802 additions and 0 deletions

591
Entities/Player/Player.tscn Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

View file

@ -0,0 +1,53 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://b8eo2wxpmpsn3"
path="res://.godot/imported/PlayerCharacter.glb-4183cc8dd55ffc9d207c3c8910d89126.scn"
[deps]
source_file="res://Entities/Player/assets/PlayerCharacter.glb"
dest_files=["res://.godot/imported/PlayerCharacter.glb-4183cc8dd55ffc9d207c3c8910d89126.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={
"meshes": {
"PlayerCharacter_mergedBlocksmesh": {
"generate/lightmap_uv": 0,
"generate/lods": 0,
"generate/shadow_meshes": 0,
"lods/normal_merge_angle": 60.0,
"save_to_file/enabled": true,
"save_to_file/path": ""
}
},
"nodes": {
"PATH:Armature/Skeleton3D": {
"retarget/bone_map": Resource("res://common/animations/Mixamo BoneMap.tres")
}
}
}
gltf/naming_version=1
gltf/embedded_image_handling=1

View file

@ -0,0 +1,51 @@
extends CharacterBody3D
@export var speed = 2
@export var fall_acceleration = 75
var target_velocity = Vector3.ZERO
func _ready() -> void:
position = Vector3.ZERO
func _physics_process(delta):
%MultiMesh3D.set("instance_shader_parameters/player_position", position)
%TileGround.update_chunks(position)
# We create a local variable to store the input direction.
var direction = Vector3.ZERO
# We check for each move input and update the direction accordingly.
if Input.is_action_pressed("move_right"):
direction.x += 1
if Input.is_action_pressed("move_left"):
direction.x -= 1
if Input.is_action_pressed("move_back"):
# Notice how we are working with the vector's x and z axes.
# In 3D, the XZ plane is the ground plane.
direction.z += 1
if Input.is_action_pressed("move_forward"):
direction.z -= 1
if direction != Vector3.ZERO:
direction = direction.normalized()
# Setting the basis property will affect the rotation of the node.
$Pivot.basis = Basis.looking_at(-direction)
# Ground Velocity
target_velocity.x = direction.x * speed
target_velocity.z = direction.z * speed
# Vertical Velocity
if not is_on_floor(): # If in the air, fall towards the floor. Literally gravity
target_velocity.y = target_velocity.y - (fall_acceleration * delta)
# Moving the Character
velocity = target_velocity
if direction != Vector3.ZERO:
%PlayerAnimationPlayer.play('basic-movement/walk')
else:
%PlayerAnimationPlayer.play('basic-movement/idle')
move_and_slide()

View file

@ -0,0 +1 @@
uid://bwed2dwogfmxv