21 lines
575 B
GDScript3
21 lines
575 B
GDScript3
|
extends MultiplayerSynchronizer
|
||
|
|
||
|
@export var rotate := 0.0
|
||
|
@export var thrust := false
|
||
|
|
||
|
const ROTATION = 0.05
|
||
|
|
||
|
# Called when the node enters the scene tree for the first time.
|
||
|
func _ready():
|
||
|
# Only process for the local player
|
||
|
set_process(get_multiplayer_authority() == multiplayer.get_unique_id())
|
||
|
|
||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||
|
func _process(delta):
|
||
|
rotate = 0.0
|
||
|
if Input.is_action_pressed("left"):
|
||
|
rotate -= ROTATION
|
||
|
if Input.is_action_pressed("right"):
|
||
|
rotate += ROTATION
|
||
|
thrust = Input.is_action_pressed("thrust")
|