i want to make a delay time or something like that so i cant spam the bullet
this the code im using for the bullet scene:
extends Area2D
const SPEED = 230
var velocity = Vector2()
var direction = 1
func _ready():
pass
func setswordshootingdirection(dir):
direction = dir
if dir == -1:
$Sprite.fliph = true
func physicsprocess(delta):
velocity.x = SPEED * delta * direction
translate(velocity)
func onswordshootingbodyentered(body):
queuefree()
func die():
yield(gettree().createtimer(1.0), "timeout")
queue_free()
func onVisibilityNotifier2Dscreenexited():
queue_free()