gd: added input addon
This commit is contained in:
12
guide_examples/two_joysticks/player.gd
Normal file
12
guide_examples/two_joysticks/player.gd
Normal file
@ -0,0 +1,12 @@
|
||||
## This is the player script. Note how we can use the same script for both
|
||||
## players, by just injecting different actions into them. No needs to check
|
||||
## which player input we should consume.
|
||||
extends Node2D
|
||||
|
||||
@export var speed:float = 150
|
||||
|
||||
@export var move_action:GUIDEAction
|
||||
|
||||
func _process(delta:float) -> void:
|
||||
position += move_action.value_axis_2d.normalized() * speed * delta
|
||||
|
Reference in New Issue
Block a user