Round system
This commit is contained in:
parent
bcb42f8d16
commit
3df8247a84
32 changed files with 573 additions and 123 deletions
|
|
@ -7,6 +7,7 @@ class_name Player
|
|||
|
||||
signal spawned
|
||||
signal health_changed(to: int)
|
||||
signal died
|
||||
|
||||
const MAX_HP = 100
|
||||
|
||||
|
|
@ -23,8 +24,6 @@ const MAX_HP = 100
|
|||
get:
|
||||
return hp
|
||||
|
||||
var TEMP_start_pos
|
||||
|
||||
func _enter_tree() -> void:
|
||||
set_multiplayer_authority(str(name).to_int())
|
||||
|
||||
|
|
@ -37,9 +36,8 @@ func _physics_process(_delta: float) -> void:
|
|||
func die() -> void:
|
||||
if (not is_multiplayer_authority()):
|
||||
return
|
||||
|
||||
global_position = TEMP_start_pos
|
||||
hp = MAX_HP
|
||||
Session.add_dead.rpc(team)
|
||||
died.emit()
|
||||
|
||||
@rpc("any_peer","call_local","reliable")
|
||||
func kill_request() -> void:
|
||||
|
|
@ -51,7 +49,6 @@ func kill_request() -> void:
|
|||
@rpc("any_peer","call_local","reliable")
|
||||
func set_after_spawn(start_position: Vector3,new_team: int):
|
||||
global_position = start_position
|
||||
TEMP_start_pos = global_position
|
||||
team = new_team as Session.TEAMS
|
||||
spawned.emit()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue