Comets.gd/scripts/bullet.gd

17 lines
407 B
GDScript3
Raw Normal View History

2024-05-09 22:42:55 -04:00
extends Area2D
@export var max_speed := 1400.00
var direction := Vector2.ZERO
2024-05-09 22:42:55 -04:00
2024-05-10 20:42:22 -04:00
2024-05-09 22:42:55 -04:00
func _process(delta: float) -> void:
2024-05-10 20:42:22 -04:00
position += direction * max_speed * delta
#print("Bullet Pos: " + str(position))
#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)
2024-05-09 22:42:55 -04:00
func _on_life_timer_timeout() -> void:
queue_free()