mirror of
https://gitlab.com/open-fpsz/open-fpsz.git
synced 2026-07-16 00:44:50 +00:00
✨ Working profile names in-game, basic settings save/load system, flag drops on player death
This commit is contained in:
parent
98cc079b38
commit
6dde93ea00
12 changed files with 122 additions and 67 deletions
Binary file not shown.
4
entities/player/collision_shape.tres
Normal file
4
entities/player/collision_shape.tres
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
[gd_resource type="CapsuleShape3D" format=3 uid="uid://cb8esdlnottdn"]
|
||||
|
||||
[resource]
|
||||
radius = 0.25
|
||||
|
|
@ -36,6 +36,7 @@ enum PlayerState { PLAYER_ALIVE, PLAYER_DEAD }
|
|||
set(id):
|
||||
player_id = id
|
||||
$PlayerInput.set_multiplayer_authority(id)
|
||||
@export var nickname : String
|
||||
|
||||
@onready var input : PlayerInput = $PlayerInput
|
||||
@onready var camera = $SpringArm3D/Camera3D
|
||||
|
|
@ -45,7 +46,7 @@ enum PlayerState { PLAYER_ALIVE, PLAYER_DEAD }
|
|||
@onready var weapon = $SpringArm3D/Inventory/SpaceGun
|
||||
@onready var animation_player : AnimationPlayer = $AnimationPlayer
|
||||
@onready var health_component = $HealthComponent
|
||||
@onready var flag_carry_component = $FlagCarryComponent
|
||||
@onready var flag_carry_component : FlagCarryComponent = $FlagCarryComponent
|
||||
@onready var spring_arm_height = $SpringArm3D.position.y
|
||||
@onready var _original_weapon_transform : Transform3D = weapon.transform
|
||||
@onready var flag_carry_attachment = $SpringArm3D/FlagCarryAttachment
|
||||
|
|
@ -65,7 +66,6 @@ func _ready():
|
|||
health_component.health_zeroed.connect(_die)
|
||||
if _is_first_person():
|
||||
camera.current = true
|
||||
flag_carry_attachment.hide()
|
||||
remove_child($ThirdPerson)
|
||||
else:
|
||||
remove_child($HUD)
|
||||
|
|
@ -214,6 +214,11 @@ func _die():
|
|||
if _is_first_person():
|
||||
animation_player.stop()
|
||||
)
|
||||
flag_carry_component.drop()
|
||||
|
||||
@rpc("call_local")
|
||||
func set_nickname(value):
|
||||
nickname = value
|
||||
|
||||
func respawn(location):
|
||||
linear_velocity = Vector3()
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
[gd_scene load_steps=21 format=3 uid="uid://cbhx1xme0sb7k"]
|
||||
|
||||
[ext_resource type="Script" path="res://entities/player/player.gd" id="1_mk68k"]
|
||||
[ext_resource type="Shape3D" uid="uid://dkwljsgaflf31" path="res://entities/player/collision_shape.res" id="2_8rtw3"]
|
||||
[ext_resource type="PackedScene" uid="uid://drbefw6akui2v" path="res://entities/player/assets/vanguard.tscn" id="2_beyex"]
|
||||
[ext_resource type="Shape3D" uid="uid://cb8esdlnottdn" path="res://entities/player/collision_shape.tres" id="2_vjqny"]
|
||||
[ext_resource type="PackedScene" uid="uid://bcv81ku26xo" path="res://interfaces/hud/hud.tscn" id="3_ccety"]
|
||||
[ext_resource type="PackedScene" uid="uid://c8co0qa2omjmh" path="res://weapons/space_gun/space_gun.tscn" id="4_lhn5w"]
|
||||
[ext_resource type="PackedScene" uid="uid://dn1tcakam5egs" path="res://weapons/space_gun/projectile.tscn" id="5_lvaut"]
|
||||
|
|
@ -180,6 +180,9 @@ properties/3/replication_mode = 2
|
|||
properties/4/path = NodePath(".:player_state")
|
||||
properties/4/spawn = true
|
||||
properties/4/replication_mode = 2
|
||||
properties/5/path = NodePath(".:nickname")
|
||||
properties/5/spawn = true
|
||||
properties/5/replication_mode = 2
|
||||
|
||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_5j4ew"]
|
||||
properties/0/path = NodePath(".:direction")
|
||||
|
|
@ -210,11 +213,11 @@ visible = false
|
|||
mesh = SubResource("CapsuleMesh_vmqfq")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
shape = ExtResource("2_8rtw3")
|
||||
shape = ExtResource("2_vjqny")
|
||||
|
||||
[node name="ShapeCast3D" type="ShapeCast3D" parent="."]
|
||||
transform = Transform3D(1.05, 0, 0, 0, 1.05, 0, 0, 0, 1.05, 0, 0, 0)
|
||||
shape = ExtResource("2_8rtw3")
|
||||
shape = ExtResource("2_vjqny")
|
||||
target_position = Vector3(0, 0, 0)
|
||||
collision_mask = 2147483656
|
||||
collide_with_areas = true
|
||||
|
|
@ -225,7 +228,7 @@ collision_mask = 8
|
|||
monitorable = false
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Sensor"]
|
||||
shape = ExtResource("2_8rtw3")
|
||||
shape = ExtResource("2_vjqny")
|
||||
|
||||
[node name="HUD" parent="." instance=ExtResource("3_ccety")]
|
||||
|
||||
|
|
@ -252,8 +255,10 @@ transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, -0.
|
|||
|
||||
[node name="HealthComponent" parent="." instance=ExtResource("5_t6i6e")]
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="HealthComponent"]
|
||||
shape = ExtResource("2_vjqny")
|
||||
|
||||
[node name="FlagCarryComponent" parent="." node_paths=PackedStringArray("attachment", "sensor") instance=ExtResource("7_e7s1a")]
|
||||
throw_velocity = 20.0
|
||||
attachment = NodePath("../SpringArm3D/FlagCarryAttachment")
|
||||
sensor = NodePath("../Sensor")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue