mirror of
https://codeberg.org/Melon-Bread/Comets.gd.git
synced 2024-11-28 15:08:20 -05:00
19 lines
447 B
GDScript
19 lines
447 B
GDScript
extends Area2D
|
|
|
|
# TODO: Tweak speed and LifeTimer values
|
|
|
|
@export var speed := 1400.00
|
|
var direction := Vector2.UP
|
|
|
|
func _physics_process(delta: float) -> void:
|
|
# Movement
|
|
position += direction.rotated(rotation) * speed * delta
|
|
|
|
# Screenwrap
|
|
var viewport_size := get_viewport_rect().size
|
|
position.x = wrap(position.x, 0, viewport_size.x)
|
|
position.y = wrap(position.y, 0,viewport_size.y)
|
|
|
|
func _on_life_timer_timeout() -> void:
|
|
queue_free()
|