initial commit

This commit is contained in:
saarsena@gmail.com 2026-04-22 10:19:57 -04:00
commit c2bb3893a9
1038 changed files with 75846 additions and 0 deletions

27
elements/actor/actor.tscn Normal file
View file

@ -0,0 +1,27 @@
[gd_scene format=3 uid="uid://cxlvpq4mb47ot"]
[ext_resource type="Script" uid="uid://s2js8mk5nstk" path="res://character_body_3d.gd" id="1_x4gbx"]
[sub_resource type="BoxShape3D" id="BoxShape3D_ryrav"]
margin = 0.578
[node name="Actor" type="CharacterBody3D" unique_id=264956013]
script = ExtResource("1_x4gbx")
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=596660177]
shape = SubResource("BoxShape3D_ryrav")
[node name="Node3D" type="Node3D" parent="." unique_id=950323032]
[node name="Camera3D" type="Camera3D" parent="Node3D" unique_id=1595290530]
[node name="OmniLight3D" type="OmniLight3D" parent="." unique_id=458090666]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0)
light_energy = 10.709
light_indirect_energy = 2.651
light_volumetric_fog_energy = 1.91
light_size = 0.195
shadow_enabled = true
omni_range = 8.65
omni_attenuation = 1.03
omni_shadow_mode = 0

View file

@ -0,0 +1,48 @@
extends Node3D
## Door entity. Place at a cell center in TrenchBroom (normal 64 grid).
## The door's local -Z is "forward" (the direction the player approaches from).
## At runtime the mesh/collision shift forward to the cell boundary so the door
## sits flush against the wall the player is facing.
## If true the door swings toward its local +Z (outward). If false it swings
## toward -Z (inward).
@export var opens_outward := true
@onready var hinge_pivot: Node3D = $HingePivot
@onready var door_collision: CollisionShape3D = $DoorBody/DoorCollision
@onready var interact_area: Area3D = $InteractArea
var _is_open := false
var _tween: Tween
const SWING_DURATION := 0.5
## How far forward (local -Z) to shift everything so the door sits on the cell boundary.
const BOUNDARY_OFFSET := 0.0
func _ready() -> void:
add_to_group("facing_interactable")
# Shift children to the cell boundary along the door's forward axis.
var offset := -transform.basis.z.normalized() * BOUNDARY_OFFSET
for child: Node3D in [hinge_pivot, $DoorBody, interact_area]:
child.global_position += offset
func try_interact(player: CharacterBody3D) -> bool:
if not interact_area.overlaps_body(player):
return false
if _tween and _tween.is_running():
return true
_is_open = !_is_open
_tween = create_tween()
var swing := -PI / 2.0 if opens_outward else PI / 2.0
var target_angle := swing if _is_open else 0.0
_tween.tween_property(hinge_pivot, "rotation:y", target_angle, SWING_DURATION)
if _is_open:
door_collision.disabled = true
else:
_tween.tween_callback(func(): door_collision.disabled = false)
return true

View file

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

View file

@ -0,0 +1,48 @@
[gd_scene format=3 uid="uid://dxwcrc6ktiyx5"]
[ext_resource type="Script" uid="uid://bvlqja7ffq8me" path="res://elements/entities/door/door.gd" id="1_script"]
[ext_resource type="Material" uid="uid://u4la7a0y4ti1" path="res://textures/tb/door/door/7a.tres" id="2_fbfc2"]
[ext_resource type="Shader" uid="uid://cdkesoyod4tga" path="res://shaders/door.gdshader" id="2_shader"]
[ext_resource type="Texture2D" uid="uid://d1ltfx6s4kou4" path="res://textures/tb/door/door/7a.png" id="3_texture"]
[sub_resource type="BoxMesh" id="BoxMesh_door"]
material = ExtResource("2_fbfc2")
size = Vector3(2, 2.6, 0.125)
[sub_resource type="ShaderMaterial" id="ShaderMaterial_door"]
render_priority = 0
shader = ExtResource("2_shader")
shader_parameter/door_texture = ExtResource("3_texture")
shader_parameter/uv_scale = Vector3(3, 2, 3)
[sub_resource type="BoxShape3D" id="BoxShape3D_m5tju"]
size = Vector3(2, 2.5, 0.125)
[sub_resource type="BoxShape3D" id="BoxShape3D_interact"]
size = Vector3(2001.897, 2.546997, 3)
[node name="Door" type="Node3D" unique_id=1729595504]
script = ExtResource("1_script")
[node name="HingePivot" type="Node3D" parent="." unique_id=29731943]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 1.12, 0)
[node name="DoorMesh" type="MeshInstance3D" parent="HingePivot" unique_id=839410192]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0)
mesh = SubResource("BoxMesh_door")
surface_material_override/0 = SubResource("ShaderMaterial_door")
[node name="DoorBody" type="StaticBody3D" parent="." unique_id=376301710]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.12, 0)
collision_mask = 0
[node name="DoorCollision" type="CollisionShape3D" parent="DoorBody" unique_id=1652482101]
shape = SubResource("BoxShape3D_m5tju")
[node name="InteractArea" type="Area3D" parent="." unique_id=1749724580]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.12, 0)
collision_layer = 0
monitorable = false
[node name="InteractShape" type="CollisionShape3D" parent="InteractArea" unique_id=329907396]
shape = SubResource("BoxShape3D_interact")

View file

@ -0,0 +1,16 @@
[gd_scene format=3 uid="uid://bikyw6mhb7vft"]
[ext_resource type="Shader" uid="uid://b5ymymo0omojq" path="res://shaders/lava.gdshader" id="1_oj3e3"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_21tsw"]
render_priority = 0
shader = ExtResource("1_oj3e3")
[sub_resource type="BoxMesh" id="BoxMesh_adv5w"]
material = SubResource("ShaderMaterial_21tsw")
size = Vector3(1, 0.05, 1)
[node name="Lava" type="Node3D" unique_id=643110970]
[node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=305927609]
mesh = SubResource("BoxMesh_adv5w")

View file

@ -0,0 +1,19 @@
extends Node3D
## Point entity marker that spawns the player actor at its position when the
## map finishes loading. The marker removes itself after spawning.
@export var actor_scene: PackedScene = preload("res://elements/actor/actor.tscn")
func _ready() -> void:
# Wait one frame so func_godot has finished setting our global_transform
# from the map file before we read it.
await get_tree().process_frame
var actor: Node3D = actor_scene.instantiate()
get_tree().current_scene.add_child(actor)
actor.global_transform = global_transform
actor.position = Grid.snap(actor.position)
queue_free()

View file

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

View file

@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://dplyrstartscn1"]
[ext_resource type="Script" path="res://elements/entities/player_start/player_start.gd" id="1_script"]
[node name="PlayerStart" type="Node3D"]
script = ExtResource("1_script")

View file

@ -0,0 +1,13 @@
extends Node3D
signal interacted(description: String)
@export var description: String = "With a close eye you notice the once red hue of the faded statue before you."
func _ready() -> void:
add_to_group("interactable")
func interact() -> void:
interacted.emit(description)

View file

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

View file

@ -0,0 +1,6 @@
[gd_scene format=3 uid="uid://dljbrlml24euq"]
[ext_resource type="Script" uid="uid://cv812jw5xvyrn" path="res://elements/entities/statue/statue.gd" id="1_0h5tx"]
[node name="Statue" type="Node3D" unique_id=1981457761]
script = ExtResource("1_0h5tx")

View file

@ -0,0 +1,17 @@
extends Node3D
signal step_triggered()
@export var one_shot: bool = false
var _triggered := false
func _ready() -> void:
add_to_group("steppable")
func stepped_on() -> void:
if one_shot and _triggered:
return
_triggered = true
step_triggered.emit()

View file

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

View file

@ -0,0 +1,6 @@
[gd_scene format=3]
[ext_resource type="Script" path="res://elements/entities/step_trigger/step_trigger.gd" id="1_script"]
[node name="StepTrigger" type="Node3D"]
script = ExtResource("1_script")

View file

@ -0,0 +1,57 @@
[gd_scene format=3 uid="uid://ddf56s1s6k8md"]
[ext_resource type="PackedScene" uid="uid://dms5mmvwgk1vx" path="res://assets/gltf/torch.gltf" id="1_m85ju"]
[ext_resource type="Shader" uid="uid://dyp8dxi24ehrk" path="res://shaders/torch.gdshader" id="2_0obdf"]
[ext_resource type="Texture2D" uid="uid://c3gwmy6sy13si" path="res://assets/gltf/Dungeon_props.png" id="3_m8jru"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_m8jru"]
render_priority = 0
shader = ExtResource("2_0obdf")
shader_parameter/albedo_tex = ExtResource("3_m8jru")
shader_parameter/emission_strength = 12.558000596505
shader_parameter/flicker_speed = 3.0
shader_parameter/flicker_amount = 0.4
shader_parameter/flame_min_r = 0.6
shader_parameter/flame_max_g = 0.6
shader_parameter/flame_max_b = 0.3
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_m8jru"]
lifetime_randomness = 0.41
turbulence_noise_scale = 0.0
turbulence_influence_min = 0.009000001
turbulence_influence_max = 0.07
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_m8jru"]
albedo_color = Color(1, 1, 0, 1)
emission_enabled = true
emission = Color(0.9607843, 0.9607843, 0.050980393, 1)
emission_on_uv2 = true
ao_enabled = true
subsurf_scatter_enabled = true
[sub_resource type="PointMesh" id="PointMesh_coxeb"]
material = SubResource("StandardMaterial3D_m8jru")
[node name="Torch" unique_id=114276604 instance=ExtResource("1_m85ju")]
[node name="torch" parent="." index="0" unique_id=1483393984]
material_override = SubResource("ShaderMaterial_m8jru")
[node name="OmniLight3D" type="OmniLight3D" parent="." index="1" unique_id=1604580557]
light_color = Color(0.9059526, 0.9046462, 0, 1)
light_energy = 3.0
shadow_enabled = true
omni_range = 8.0
[node name="GPUParticles3D" type="GPUParticles3D" parent="." index="2" unique_id=44151893]
lifetime = 8.91
interp_to_end = 0.15
preprocess = 1.0
explosiveness = 0.84
randomness = 0.14
process_material = SubResource("ParticleProcessMaterial_m8jru")
draw_passes = 4
draw_pass_1 = SubResource("PointMesh_coxeb")
draw_pass_2 = null
draw_pass_3 = null
draw_pass_4 = null

View file

@ -0,0 +1,12 @@
extends Node3D
signal trap_triggered(damage: int)
@export var damage: int = 1
func _ready() -> void:
add_to_group("steppable")
func stepped_on() -> void:
trap_triggered.emit(damage)
print("Trap triggered! Dealing ", damage, " damage to the player.")

View file

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

View file

@ -0,0 +1,6 @@
[gd_scene format=3 uid="uid://c4wux0bxkjv7v"]
[ext_resource type="Script" uid="uid://c15068gqlfkly" path="res://elements/entities/trap/trap.gd" id="1_q5awx"]
[node name="Trap" type="Node3D" unique_id=1227817009]
script = ExtResource("1_q5awx")

File diff suppressed because one or more lines are too long

10198
elements/game/game.tscn Normal file

File diff suppressed because one or more lines are too long