class_name Ball extends RigidBody2D signal kace_broken var grid:TileMap func _integrate_forces(state : Physics2DDirectBodyState): for i in range(state.get_contact_count()): var contact_pos = state.get_contact_local_position(i) var tile_pos = grid.world_to_map(contact_pos) var cell = grid.get_cellv(tile_pos) if cell != TileMap.INVALID_CELL and cell == 0: grid.set_cellv(tile_pos, -1) emit_signal("kace_broken")