Updates
This commit is contained in:
parent
8d5714c215
commit
ffba3fce8c
12 changed files with 202 additions and 5 deletions
|
@ -17,6 +17,8 @@ var last_grounded = 0
|
|||
# Get the gravity from the project settings to be synced with RigidBody nodes.
|
||||
var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")
|
||||
|
||||
var gun: Node2D
|
||||
|
||||
func _ready():
|
||||
$MultiplayerSynchronizer.set_multiplayer_authority(name.to_int())
|
||||
var username = GameManager.players[name.to_int()].name
|
||||
|
@ -25,6 +27,7 @@ func _ready():
|
|||
for i in username.length():
|
||||
username_hash += username.unicode_at(i)
|
||||
$Sprite2D.modulate = Color.from_hsv((username_hash % 255) / 255.0, 0.5, 0.8)
|
||||
gun = $Gun
|
||||
|
||||
func _physics_process(delta):
|
||||
if $MultiplayerSynchronizer.get_multiplayer_authority() != multiplayer.get_unique_id():
|
||||
|
@ -34,7 +37,9 @@ func _physics_process(delta):
|
|||
if is_on_floor():
|
||||
last_grounded = Time.get_ticks_msec()
|
||||
else:
|
||||
velocity.y += gravity * delta * (limp_gravity_modifier if Input.is_action_pressed("limp") else 1)
|
||||
velocity.y += gravity * delta * (limp_gravity_modifier if Input.is_action_pressed("limp") else 1.0)
|
||||
|
||||
gun.look_at(get_global_mouse_position())
|
||||
|
||||
var grounded = Time.get_ticks_msec() - last_grounded < fox_time
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue