Removing unlinked bubbles

The last step to a Puzzle Bobble prototype is removing unchained bubbles.

The idea: Everything turns around the concept of connected bubbles. We can say a bubble is connected when it's on the highest row or when it's adjacent to at least one connected bubble. With this in mind, each bubble which is not adjacent to at least one connected bubble must be removed.

The development: We need a new array to keep track of all connections. Let's create it as a class level variable and call it connArray. It will be used in a kind of flood fill for connected bubbles.

private const ROT_SPEED:uint=2; private const R:uint=18; private const D:Number=R*Math.sqrt(3); private const DEG_TO_RAD:Number=0.0174532925; private const BUBBLE_SPEED:uint=10; ...

Get Flash Game Development by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.