mirror of
https://codeberg.org/Melon-Bread/Comets.gd.git
synced 2025-07-06 22:54:36 -04:00
Set up groups, layers, and bullet wrap around
This commit is contained in:
@ -1,8 +1,13 @@
|
||||
extends Area2D
|
||||
|
||||
@export var max_speed := 1400.00
|
||||
|
||||
var direction := Vector2.ZERO
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
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()
|
||||
|
@ -17,6 +17,7 @@ func _process(delta: float) -> void:
|
||||
position += velocity * delta
|
||||
|
||||
if velocity.length() > 0.0:
|
||||
# TODO: Have the CollisionShape toate with the sprite
|
||||
$Sprite2D.rotation = velocity.angle()
|
||||
|
||||
var viewport_size := get_viewport_rect().size
|
||||
|
Reference in New Issue
Block a user