Set up a revised player scene with a component based apparoach; shooting
functionality incomplete.
This commit is contained in:
parent
8d89271074
commit
9b3841775c
13 changed files with 331 additions and 0 deletions
11
scripts/input_component.gd
Normal file
11
scripts/input_component.gd
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
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")
|
||||
Loading…
Add table
Add a link
Reference in a new issue