class_name Bullet extends Area2D signal bulletHitSignal(body, bullet) @onready var bullet_graphic: Sprite2D = $BulletGraphic var SPEED: float = 700.0 func setSpeed(new_speed: float): SPEED = new_speed if new_speed < 0: bullet_graphic.flip_h = true if new_speed > 0: bullet_graphic.flip_h = false func _physics_process(delta: float) -> void: position += transform.x * SPEED * delta func _on_body_entered(body: Node2D) -> void: if body.is_in_group("shootable"): bulletHitSignal.emit(body, self)