PDA

View Full Version : [AS3] Breakout Game Problem


Crazysheep
10-01-2009, 11:01 AM
Hi, I'm a real newbie at flash.
Basically I need someone to help explain how I could make a breakout game.

The only problem I have is that I don't know how I could make the ball bounce off every brick without giving instance names to every single brick MovieClip and copy + pasting code a million times.

I'm thinking arrays or something.

Help please? Thanks.

(As you can see I'm a real newbie)

rrh
10-01-2009, 03:47 PM
Look up tutorials on an "Array" and a "for loop" and "Array.length"

Then you can .push() all your bricks into an array and then loop through the array.

Crazysheep
10-02-2009, 01:02 PM
Thanks!
That seems about right, I've seen that .push() thing mentioned in several places. I'll have a look now, thanks again.