Grouping Type objects together?

Blitz3D Forums/Blitz3D Programming/Grouping Type objects together?

Cancerian(Posted 2004) [#1]
I'm developing one of those "colour-combo" kind of games where you have to eliminate various coloured enemies by shooting them with coloured bullets, similar to Puzzle Bobble. Here's an early screenshot:



The challenge I'm facing at the moment is with my Time Trial mode in which the player simply tries to eliminate x number of rows in the fastest time possible. This mode is set up so that a new row of "meanies" will drop into place once an existing row has been eliminated.

I created the enemies as types because it makes them easy to deal with on an individual basis but I'm stuck as to how to tell when an entire row of them has been eliminated. Right now the only Type fields they have is their x and y positions,animation frame and color.

Any hints of help would be appreciated. Thanks!


big10p(Posted 2004) [#2]
Store you 'meanie' types in a 2 dimensional array. When you hit a meanie, set it's array position to NULL and scan the rest of the array row to see if there are any more meanies left on that row.


QuietBloke(Posted 2004) [#3]
also as well as big10p's suggestion you could create a single array (eg rowcount[]) . Everytime you create a meanie increment the appropriate rowcount. When you delete one then decrement it. Then instead of having to scan the array row to see if it is empty you can just check the rowcount[] for the row and see if the value is zero.