feat: integrate ChaffGames FPS template as local player controller
Replaces the overhead box-mesh view with a full FPS character: - mouse look, WASD movement, jump (Space), crouch (C), sprint (Shift), lean (Q/E) - 6 weapons (LMB shoot, R reload, scroll switch, F melee, G drop) - Crosshair HUD, ammo counter, sprint bar - Client sends position to server at 20Hz for multiplayer visibility - Server broadcasts positions to all peers - Remote players shown as boxes (placeholder) source: https://godotengine.org/asset-library/asset/2652 (MIT license)
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
extends RigidBody3D
|
||||
class_name WeaponPickUp
|
||||
|
||||
@export var weapon: WeaponSlot
|
||||
@export_enum("Weapon","Ammo") var TYPE = "Weapon"
|
||||
|
||||
var Pick_Up_Ready: bool = false
|
||||
|
||||
func _ready():
|
||||
await get_tree().create_timer(2.0).timeout
|
||||
Pick_Up_Ready = true
|
||||
@@ -0,0 +1 @@
|
||||
uid://deaf6cmuofa0
|
||||
@@ -0,0 +1,18 @@
|
||||
extends RigidBody3D
|
||||
|
||||
@export var _weapon_name: String
|
||||
@export var _current_ammo: int
|
||||
@export var _reserve_ammo: int
|
||||
|
||||
const TYPE = "Ammo"
|
||||
|
||||
var Pick_Up_Ready: bool = false
|
||||
|
||||
func _ready():
|
||||
await get_tree().create_timer(2.0).timeout
|
||||
Pick_Up_Ready = true
|
||||
|
||||
func Set_Ammo(w_name: String, c_ammo : int, r_ammo : int):
|
||||
if w_name == _weapon_name:
|
||||
_current_ammo = c_ammo
|
||||
_reserve_ammo = r_ammo
|
||||
@@ -0,0 +1 @@
|
||||
uid://dvxmf6dpx0qdn
|
||||
Reference in New Issue
Block a user