class_name Bullet extends Area2D @onready var bullet_graphic: Sprite2D = $BulletGraphic var speed:float = 700; signal bulletDamageSignal(body, bullet) # Called when the node enters the scene tree for the first time. func _ready() -> void: pass # Replace with function body. func setSpeed(value)->void: speed=value if speed <0: bullet_graphic.flip_h = true if speed >0: bullet_graphic.flip_h = false # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: position += transform.x * speed * delta func _on_body_entered(body: Node2D) -> void: bulletDamageSignal.emit(body, self)