ad48f38ca5
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)
19 lines
390 B
GDScript
19 lines
390 B
GDScript
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
|