feat: add state machine movement classes, double barrel shotgun weapon, and test level builder utility

This commit is contained in:
DottsGit
2026-06-04 01:21:50 -04:00
parent a54b3d89b1
commit 45fb7f0f38
6 changed files with 177 additions and 42 deletions
+14 -3
View File
@@ -64,8 +64,8 @@ func _build_input_map() -> void:
"sprint": [KEY_SHIFT],
"crouch": [KEY_CTRL],
"dash": [KEY_SHIFT],
"fire": [MOUSE_BUTTON_RIGHT, KEY_F],
"fire_alt": [MOUSE_BUTTON_LEFT],
"fire": [MOUSE_BUTTON_LEFT, KEY_F],
"fire_alt": [MOUSE_BUTTON_RIGHT],
"reload": [KEY_R],
"interact": [KEY_E],
"move_forward": [KEY_W],
@@ -262,8 +262,9 @@ func _build_lighting() -> void:
func _build_player() -> void:
var player := CharacterBody3D.new()
player.name = "Player"
player.position = Vector3(0, 1.0, 8)
player.position = Vector3(0, 1.0, 0)
add_child(player)
_player = player
# Collision shape
var col_shape := CollisionShape3D.new()
@@ -316,6 +317,16 @@ func _build_player() -> void:
camera.current = true
camera.fov = 90.0
head_pivot.add_child(camera)
# ── Temporary Weapon Setup ──────────────────────────────────────────────────
# TODO: Change how the player is given weapons in the future to a loadout schema.
var shotgun_script = preload("res://weapons/double_barrel_shotgun.gd")
if shotgun_script:
var shotgun = shotgun_script.new()
shotgun.name = "DoubleBarrelShotgun"
shotgun.player = player
shotgun.camera = camera
camera.add_child(shotgun)
var rig_script = preload("res://characters/player/fps_camera_rig.gd")
if rig_script: