e1410c234a
Checkpoint of the existing flat file layout prior to restructuring into autoload/, menu/, ships/, world/, and assets/ folders. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
22 lines
559 B
GDScript
22 lines
559 B
GDScript
extends Area2D
|
|
|
|
var velocity: Vector2 = Vector2.ZERO
|
|
var source: Node = null
|
|
|
|
func _ready() -> void:
|
|
body_entered.connect(_on_body_entered)
|
|
|
|
func _process(delta: float) -> void:
|
|
global_position += velocity * delta
|
|
var screen = get_viewport_rect().size
|
|
if (global_position.x < 0 or global_position.x > screen.x or
|
|
global_position.y < 0 or global_position.y > screen.y):
|
|
queue_free()
|
|
|
|
func _on_body_entered(body: Node) -> void:
|
|
if body == source:
|
|
return
|
|
if body.has_method("take_damage"):
|
|
body.take_damage(GameConfig.bullet_damage)
|
|
queue_free()
|