GMTK-2024/gmtk_2024/scripts/enemy_movement_mover.gd
2024-08-17 17:33:34 +02:00

13 lines
255 B
GDScript

extends CharacterBody2D
@export var speed = 200;
@export var gravity = 50;
@export var direction = 1;
func _physics_process(delta):
if is_on_wall():
direction = direction * -1
velocity.x = direction * speed
velocity.y += gravity
move_and_slide()