extends Area2D @onready var bulletsprite: Sprite2D = $Sprite2D var speed := 700 signal hit(bullet, body) func setSpeed(speedVal): speed = speedVal if speedVal < 0: bulletsprite.flip_h = true else: bulletsprite.flip_h = false func _physics_process(delta: float) -> void: position += transform.x * speed * delta func _on_body_entered(body: Node2D) -> void: if body is Enemy: print("blow away enemy") func _on_area_entered(area: Area2D) -> void: if area is Enemy: print("blow this enemy away") hit.emit(self, area)