I am trying to make a tile based game. Bricks breaking. see image below and actionscript 3.0 outputs
Here i removed a colored area with a floodfill algorithm.
The tile above it ( alpha effect ) must shift down X pixels (tilesize). In some colums the tiles must shift down 1 tile, in others 2 or more....
Has anyone a solution to this problem? The game is tile base and update its values with a multidimensional array.
I can provide my AS3.0 script if required..
Sorry, but this doesn't make a lot of sense. You say it's tile based - but then you say you removed squares using flood fill - which is a bitmapData method. If it really is tiles then all the squares should be individual objects (tiles) and then you can move remove and move them as needed. If it's a bitmap I think you're going to have some trouble getting it to work.
Yes, please provide your As3. I disagree with dm..., you absolutely can have a tile-based game that uses bitmap methods where the tiles are represented in data. However, without some kind of understanding of what your tile data looks like and how that connects with your bitmap information, it's going to be difficult to offer suggestions.
>> you absolutely can have a tile-based game that uses bitmap methods where the tiles are represented in data
Of course. I didn't mean to say you couldn't do it. I'm just not uderstanding where the problem lies - if the OP can draw the tile data to the screen, from the tile array, then there should be no trouble redrawing once some tiles have been removed... the fact that there is a problem just made me think that maybe going the bitmap route was overkill.
Europe, Middle East and Africa