20 lines
402 B
GDScript
20 lines
402 B
GDScript
class_name Enemy extends StaticBody2D
|
|
# used StaticBody to get around gravity, probably a better way
|
|
|
|
# there is probably a better built-in to use here, maybe not for static body
|
|
@export var direction:int = 1
|
|
const SPEED = 1
|
|
var drop = false
|
|
|
|
func _ready():
|
|
pass
|
|
|
|
func go_down():
|
|
drop = true
|
|
|
|
func _process(_delta):
|
|
move_local_x(SPEED * direction)
|
|
if drop:
|
|
move_local_y(SPEED * 5)
|
|
drop = false
|