11 lines
324 B
GDScript
11 lines
324 B
GDScript
class_name InputComponent extends Node
|
|
|
|
var move_dir: Vector2 = Vector2.ZERO
|
|
var shoot_pressed: bool = false
|
|
var shooting: bool = false
|
|
|
|
|
|
func update() -> void:
|
|
move_dir = Input.get_vector("left", "right", "up", "down")
|
|
shoot_pressed = Input.is_action_just_pressed("shoot")
|
|
shooting = Input.is_action_pressed("shoot")
|