PDA

View Full Version : [AS3] Creating levels in Breakout game


wyattt
03-15-2009, 06:13 PM
Hello,

I'm attempting to make a Breakout game in AS3. The main thing I am having trouble with is creating custom levels. Creating rows and columns of bricks is easy, but I can't figure out how to make it so I can choose where bricks are/aren't using loops/arrays. I want it to be so where I place a 1 it places a brick and a 0 it doesn't, ie.

var row1:Array=new Array([1,1,1,1,1,1,1,1,1,1,1]);
var row2:Array=new Array([1,0,0,0,0,0,0,0,0,0,1]);

and have the level start out like that. I have a bricks array but I'm just not really sure where to go from here. Any help would be appreciated. Thanks!

fnx
03-16-2009, 09:50 AM
Hello wyattt, I don't know how far are you with the game, anyway if you want to do an AS3 breakout i suggest you this tutorial: http://www.gamedev.net/reference/programming/features/flex/

It started as a Flex SDK introduction but it goes through the creation on a breakout clone. I've started from that tutorial too some time ago :)

Hope this helps!