mirror of
https://codeberg.org/Melon-Bread/Comets.gd.git
synced 2024-11-24 21:18:21 -05:00
Makde the life span of the bullet changeable
This commit is contained in:
parent
15ab4d720e
commit
fed245fee2
@ -2,11 +2,17 @@ extends Area2D
|
|||||||
|
|
||||||
@export var speed := 1400.00
|
@export var speed := 1400.00
|
||||||
var direction := Vector2.UP
|
var direction := Vector2.UP
|
||||||
|
var life_span = 0.5
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
$LifeTimer.wait_time = life_span
|
||||||
|
|
||||||
func _physics_process(delta: float) -> void:
|
func _physics_process(delta: float) -> void:
|
||||||
# Movement
|
# Movement
|
||||||
position += direction.rotated(rotation) * speed * delta
|
position += direction.rotated(rotation) * speed * delta
|
||||||
|
|
||||||
|
print(rotation)
|
||||||
|
|
||||||
# Screenwrap
|
# Screenwrap
|
||||||
var viewport_size := get_viewport_rect().size
|
var viewport_size := get_viewport_rect().size
|
||||||
position.x = wrap(position.x, 0, viewport_size.x)
|
position.x = wrap(position.x, 0, viewport_size.x)
|
||||||
|
Loading…
Reference in New Issue
Block a user