diff --git a/scripts/bullet.gd b/scripts/bullet.gd index 07148d5..7717984 100644 --- a/scripts/bullet.gd +++ b/scripts/bullet.gd @@ -2,11 +2,17 @@ extends Area2D @export var speed := 1400.00 var direction := Vector2.UP +var life_span = 0.5 + +func _ready() -> void: + $LifeTimer.wait_time = life_span func _physics_process(delta: float) -> void: # Movement position += direction.rotated(rotation) * speed * delta + print(rotation) + # Screenwrap var viewport_size := get_viewport_rect().size position.x = wrap(position.x, 0, viewport_size.x)