Set up groups, layers, and bullet wrap around

This commit is contained in:
2024-05-09 23:04:36 -04:00
parent a5e7731b47
commit c13e23cdd3
4 changed files with 10 additions and 5 deletions

View File

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

View File

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