extends KinematicBody2D
var direction = Vector2.LEFT
func _physics_process(delta: float) -> void:
var velocity = direction
velocity.x = direction.x * 150
move_and_slide(velocity, Vector2.UP)
var collision = move_and_collide(velocity * delta)
if collision:
collision.collider.move_and_collide(velocity * delta)
func _on_VisibilityNotifier2D_screen_exited() -> void:
queue_free()
func _on_Jump_over_Checker_body_shape_entered(body_id: int, body: Node, body_shape: int, local_shape: int) -> void:
if body.name == "Player":
Score.update_score(1)
it is for a enemy i call via preload