Falling ball game experiment

balls
Falling ball game
I’ve never been the one for quick reaction games but the popularity among some people when I show them this outstrips how damned easy it was to build.

I think I spent about 30 minutes to an hour on this, just to refresh my memory on some basics after the summer holiday.

  1. Make a movieClip
  2. add an onEnterFrame,
  3. if the ball is on the stage this.y = y+5.
  4. if not, is y < -5 or > stage.height ? success || fail
  5. create on onClickFunction, this.y = y-15;
  6. On the stage create a counter, create as many balls , as counter in an array, and then use counter a level. And radomise ther ball.x spawn position (be carefull of where you spawn the y and what you declare a win)
  7. just keep track of the success and fails of your balls.

It’s that damned simple, I probably spent more time getting the gradient effect on the ball than I did the code.

Things to learn,
AS2 hit detection is apparently better as a button than a MovieClip, plus the hit-area could have been a bit bigger.
Obviously some things are missing from a proper game menu things, click to start, instructions, maybe some trance music, some pickups that slow down time, thinks not to click, speed up time add another ball….maybe do the same in CS4, but like do it using Z instead of Y…..hmmm I feel another experiment comming

0 Responses to “Falling ball game experiment”


Comments are currently closed.