class_name Core extends StaticBody2D ## The red core. Hitting it in the game scene wins the level. ## Nominal radius; the core is drawn and collides [constant Block.GAP] / 2 inside it, like the ## blocks, so the gap to the first ring matches the gap between tiles. @export var radius := Params.CORE_RADIUS func _ready() -> void: collision_layer = Params.LAYER_BLOCKS collision_mask = 0 var shape := CircleShape2D.new() shape.radius = radius - Block.GAP / 2.0 var collision := CollisionShape2D.new() collision.shape = shape add_child(collision) ## Grows to fill the screen; returns when the animation ends. func explode() -> void: collision_layer = 0 var tween := create_tween() tween.tween_property(self, "scale", scale * 20.0, 1.0) await tween.finished func _draw() -> void: draw_circle(Vector2.ZERO, radius - Block.GAP / 2.0, Params.COLOR_RED, true, -1.0, true)