added Graphics and sound Effects and more overhauls
This commit is contained in:
parent
c887a2168c
commit
b9d4288900
214 changed files with 3378 additions and 198 deletions
23
addons/virtual_joystick/test/player.gd
Normal file
23
addons/virtual_joystick/test/player.gd
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
extends Sprite2D
|
||||
|
||||
@export var speed : float = 100
|
||||
|
||||
@export var joystick_left : VirtualJoystick
|
||||
|
||||
@export var joystick_right : VirtualJoystick
|
||||
|
||||
var move_vector := Vector2.ZERO
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
## Movement using the joystick output:
|
||||
# if joystick_left and joystick_left.is_pressed:
|
||||
# position += joystick_left.output * speed * delta
|
||||
|
||||
## Movement using Input functions:
|
||||
move_vector = Vector2.ZERO
|
||||
move_vector = Input.get_vector("ui_left","ui_right","ui_up","ui_down")
|
||||
position += move_vector * speed * delta
|
||||
|
||||
# Rotation:
|
||||
if joystick_right and joystick_right.is_pressed:
|
||||
rotation = joystick_right.output.angle()
|
||||
Loading…
Add table
Add a link
Reference in a new issue