Makde the life span of the bullet changeable

This commit is contained in:
Rain Clark 2024-05-16 13:42:48 -04:00
parent 15ab4d720e
commit fed245fee2

View File

@ -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)