Hey guys, I’m trying to make a puzzle bubble clone but I’m stumped on how to handle the background stuff. Mostly with the fact that the lines don’t match up (i.e: instead of a bubble having another no top of it, one on the upper-left and one on the upper-right, it has one on the upper left and one on the upper right http://dl.dropbox.com/u/680263/puzzle_bobble_2.jpg) and how to determine which bubbles pop when I make shot (and which fall) without making a brute-force algorithm that would make my i7 cry.
Can anyone give some sugestions on how to handle this?
Does it have to be a multi-dimensional array? How about a “bubble” structure like this:
Then when you pop a given bubble, you can do a tree traverse down both ways and sideways both ways, and get rid of any “island” of bubbles that are not eventually attached to the top wall. Bear in mind bubbles can be supported by “arms” of other bubbles from the side or below.
I suspect that this is less storage efficient, but more speed efficient, than using a multi-dimensional array.