29 lines
636 B
GDScript3
29 lines
636 B
GDScript3
|
|
#@tool
|
||
|
|
#@icon
|
||
|
|
#class_name
|
||
|
|
extends CharacterBody2D
|
||
|
|
## Documentation comments
|
||
|
|
|
||
|
|
## Signals
|
||
|
|
## Enums
|
||
|
|
## Constants
|
||
|
|
## @export variables
|
||
|
|
@export var speed: int = 10
|
||
|
|
## Regular variables
|
||
|
|
var input_vector: Vector2
|
||
|
|
## @onready variables
|
||
|
|
|
||
|
|
## Overridden built-in virtual methods
|
||
|
|
#func _init() -> void:
|
||
|
|
#func _enter_tree() -> void:
|
||
|
|
#func _ready() -> void:
|
||
|
|
#func _process(delta: float) -> void:
|
||
|
|
func _physics_process(_delta: float) -> void:
|
||
|
|
input_vector = Input.get_vector("left", "right", "up", "down")
|
||
|
|
velocity = input_vector * speed
|
||
|
|
move_and_slide()
|
||
|
|
## Remaining virtual methods
|
||
|
|
## Overridden custom methods
|
||
|
|
## Remaining methods
|
||
|
|
## Subclasses
|