extends Area2D ## KINETIC slug: damage plus knockback along its travel direction. ## Knockback is the load-bearing part — KINETIC is the one tag that ## touches the piloting layer, and the HEAT+KINETIC chemistry row ## (next slice) rides on impacts this weapon causes. @export var speed := 420.0 @export var damage := 1.0 @export var knockback := 220.0 @export var lifetime := 0.8 var direction := Vector2.RIGHT func _ready() -> void: add_to_group("projectiles") rotation = direction.angle() # Runtime load, not preload — resilient to a stale import cache. var spr := Sprite2D.new() spr.texture = load("res://assets/sprites_ph/slug_ph.png") add_child(spr) body_entered.connect(_on_body_entered) func _physics_process(delta: float) -> void: position += direction * speed * delta lifetime -= delta if lifetime <= 0.0: queue_free() func _on_body_entered(body: Node) -> void: if body.is_in_group("enemies"): body.hit(damage, direction * knockback) queue_free()