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

View file

@ -0,0 +1,43 @@
[gd_scene load_steps=7 format=3 uid="uid://bwcevwwphdvq"]
[ext_resource type="Script" uid="uid://bq7hia2dit80y" path="res://Entities/GroundTile/ground_tile.gd" id="1_uwxqs"]
[ext_resource type="PackedScene" uid="uid://ckesk3bs6g7tt" path="res://Stages/Test3D/assets/fish.glb" id="2_h4g11"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_oqd8f"]
albedo_color = Color(0.171, 0.57, 0.24415, 1)
[sub_resource type="PlaneMesh" id="PlaneMesh_oqd8f"]
[sub_resource type="BoxShape3D" id="BoxShape3D_h4g11"]
size = Vector3(2, 2, 2)
[sub_resource type="ViewportTexture" id="ViewportTexture_h4g11"]
viewport_path = NodePath("DebugText")
[node name="GroundTile" type="Node3D"]
script = ExtResource("1_uwxqs")
[node name="Ground" type="MeshInstance3D" parent="."]
material_override = SubResource("StandardMaterial3D_oqd8f")
mesh = SubResource("PlaneMesh_oqd8f")
[node name="GroundCollision" type="StaticBody3D" parent="."]
[node name="CollisionShape3D" type="CollisionShape3D" parent="GroundCollision"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)
shape = SubResource("BoxShape3D_h4g11")
[node name="fish2" parent="." instance=ExtResource("2_h4g11")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00713956, 0, 0.0313604)
[node name="DebugText" type="SubViewport" parent="."]
size = Vector2i(50, 50)
[node name="DebugTextLabel" type="Label" parent="DebugText"]
offset_right = 40.0
offset_bottom = 23.0
text = "Hello world"
[node name="Sprite3D" type="Sprite3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.0939356)
texture = SubResource("ViewportTexture_h4g11")

View file

@ -0,0 +1,26 @@
extends Node3D
@onready var debug_text: Label = $DebugText/DebugTextLabel
var grid_x: int
var grid_z: int
var cell_info: CellDataResource
func _ready() -> void:
if cell_info != null:
update_text_label()
func set_grid_location(x, z) -> void:
grid_x = x
grid_z = z
cell_info = MapData.get_map_data(grid_x, grid_z)
var debug_dict = {}
if cell_info.get_script():
var script_properties = cell_info.get_script().get_script_property_list()
for prop in script_properties:
debug_dict[prop.name] = cell_info.get(prop.name)
Log.pr(debug_dict)
func update_text_label() -> void:
debug_text.text = str(grid_x) + ', ' + str(grid_z) + ', ' + str(cell_info.cell_seed)

View file

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

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