feat: Implement core game mechanics including player, enemies, bullets, HUD, and level setup.
This commit is contained in:
14
scripts/ammo_pickup.gd
Normal file
14
scripts/ammo_pickup.gd
Normal file
@@ -0,0 +1,14 @@
|
||||
extends Area2D
|
||||
|
||||
@export_enum("AP", "HE") var ammo_type: int = 0
|
||||
@export var amount: int = 10
|
||||
|
||||
func _ready():
|
||||
body_entered.connect(_on_body_entered)
|
||||
|
||||
func _on_body_entered(body):
|
||||
if body.is_in_group("player"):
|
||||
var turret = body.get_node_or_null("turret")
|
||||
if turret and turret.has_method("add_ammo"):
|
||||
turret.add_ammo(ammo_type, amount)
|
||||
queue_free()
|
||||
Reference in New Issue
Block a user