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,41 @@
|
||||
extends Node
|
||||
class_name Spray_Profile
|
||||
|
||||
@export_category("Random_Spray")
|
||||
@export var Spray_Noise: FastNoiseLite
|
||||
@export_range(0.0,10.0) var Random_Spray_Multiplier: float = 1.0
|
||||
@export var Max_Limit: int = 30
|
||||
@export var Updwards_Lock: bool = false
|
||||
@export var True_Random: bool = true
|
||||
|
||||
@export_category("Path_Spray")
|
||||
@export var Spray_Path: Path2D
|
||||
@export_range(0.0,10.0) var Path_Spray_Multiplier: float = 1.0
|
||||
@export_range(0.0,1.0) var Spray_Mix: float = 1.0
|
||||
|
||||
var Random_Spray: Vector2 = Vector2.ZERO
|
||||
var Spray_Vector: Vector2 = Vector2.ZERO
|
||||
|
||||
func Get_Spray(count: int,_max_count: int)->Vector2:
|
||||
if Spray_Noise:
|
||||
if True_Random:
|
||||
Spray_Noise.set_seed(randi())
|
||||
|
||||
var x = Spray_Noise.get_noise_1d(count)*min(count,Max_Limit)
|
||||
var y = Spray_Noise.get_noise_2d(_max_count,count)*min(count,Max_Limit)
|
||||
|
||||
if Updwards_Lock:
|
||||
y = -abs(y)
|
||||
|
||||
Random_Spray = Vector2(x,y)*Random_Spray_Multiplier
|
||||
|
||||
if Spray_Path:
|
||||
var Path_Points: Curve2D = Spray_Path.get_curve()
|
||||
var Point_Count: int = Path_Points.get_point_count()
|
||||
count = min(count-1,Point_Count-1)
|
||||
|
||||
Spray_Vector = Path_Points.get_point_position(count)*Path_Spray_Multiplier
|
||||
|
||||
|
||||
var Spray = Spray_Vector + (Random_Spray*Spray_Mix)
|
||||
return Spray
|
||||
@@ -0,0 +1 @@
|
||||
uid://dvcpsronqmkmr
|
||||
@@ -0,0 +1,20 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://ciu0xkaw0ioef"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dvcpsronqmkmr" path="res://client/template/Spawnable_Objects/SprayProfiles/spray_profile.gd" id="1_60v4d"]
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_4msk4"]
|
||||
|
||||
[sub_resource type="Curve2D" id="Curve2D_0vouc"]
|
||||
_data = {
|
||||
"points": PackedVector2Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -2, 0, 0, 0, 0, 0, -11, 0, 0, 0, 0, 1, -23, 0, 0, 0, 0, 2, -35, 0, 0, 0, 0, -4, -50, 0, 0, 0, 0, -7, -62, 0, 0, 0, 0, -12, -69, 0, 0, 0, 0, -6, -76, 0, 0, 0, 0, 12, -74, 0, 0, 0, 0, 9, -86, 0, 0, 0, 0, 16, -81, 0, 0, 0, 0, 21, -76, 0, 0, 0, 0, 19, -83, 0, 0, 0, 0, 23, -84, 0, 0, 0, 0, 36, -82, 0, 0, 0, 0, 35, -79, 0, 0, 0, 0, 28, -81, 0, 0, 0, 0, 23, -81, 0, 0, 0, 0, 5, -88, 0, 0, 0, 0, 2, -90, 0, 0, 0, 0, -6, -88, 0, 0, 0, 0, -10, -91, 0, 0, 0, 0, -12, -91, 0, 0, 0, 0, -13, -89, 0, 0, 0, 0, -13, -85, 0, 0, 0, 0, -15, -85, 0, 0, 0, 0, -16, -88, 0, 0, 0, 0, -19, -90, 0, 0, 0, 0, -20, -85)
|
||||
}
|
||||
point_count = 30
|
||||
|
||||
[node name="Spray_Profile" type="Node" node_paths=PackedStringArray("Spray_Path")]
|
||||
script = ExtResource("1_60v4d")
|
||||
Spray_Noise = SubResource("FastNoiseLite_4msk4")
|
||||
Spray_Path = NodePath("Path2D")
|
||||
Path_Spray_Multiplier = 0.58
|
||||
|
||||
[node name="Path2D" type="Path2D" parent="."]
|
||||
curve = SubResource("Curve2D_0vouc")
|
||||
@@ -0,0 +1,19 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://3mb12hvruajh"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dvcpsronqmkmr" path="res://client/template/Spawnable_Objects/SprayProfiles/spray_profile.gd" id="1_35g6m"]
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_4msk4"]
|
||||
seed = 145
|
||||
frequency = 0.307
|
||||
cellular_jitter = -1.115
|
||||
cellular_return_type = 0
|
||||
domain_warp_type = 1
|
||||
domain_warp_amplitude = 30.075
|
||||
domain_warp_frequency = -0.835
|
||||
domain_warp_fractal_type = 2
|
||||
domain_warp_fractal_octaves = 1
|
||||
|
||||
[node name="Spray_Profile" type="Node"]
|
||||
script = ExtResource("1_35g6m")
|
||||
Spray_Noise = SubResource("FastNoiseLite_4msk4")
|
||||
Random_Spray_Multiplier = 2.371
|
||||
@@ -0,0 +1,20 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://ceuaamuau8pl8"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dvcpsronqmkmr" path="res://client/template/Spawnable_Objects/SprayProfiles/spray_profile.gd" id="1_hmoot"]
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_4msk4"]
|
||||
seed = 145
|
||||
frequency = 0.307
|
||||
cellular_jitter = -1.115
|
||||
cellular_return_type = 0
|
||||
domain_warp_type = 1
|
||||
domain_warp_amplitude = 30.075
|
||||
domain_warp_frequency = -0.835
|
||||
domain_warp_fractal_type = 2
|
||||
domain_warp_fractal_octaves = 1
|
||||
|
||||
[node name="Spray_Profile" type="Node"]
|
||||
script = ExtResource("1_hmoot")
|
||||
Spray_Noise = SubResource("FastNoiseLite_4msk4")
|
||||
Random_Spray_Multiplier = 10.0
|
||||
Updwards_Lock = true
|
||||
Reference in New Issue
Block a user