PDA

View Full Version : help with simple clicking game


anilin
09-04-2008, 05:53 PM
Hi,
I am new to flash and just made a very simple game. A number of balls just fly around and when user click a ball, it will dissappear. This part I know how to do. But I want to change it to when user click a ball, it will break into 2 parts and those 2 parts will dissappear. I am not sure how to do it though :(

Can you guys give me ideas on it?

Thank you very much:D

rrh
09-04-2008, 06:06 PM
How did you create the first balls? Can you do the same thing to create two smaller pieces?

Jas_The_Ace
09-04-2008, 06:12 PM
How about you make the ball into a movieclip. The first frame code of the movieclip says stop(); The next few frames show two halves flying apart.
When the user clicks on the ball, you can say iBall.play(); The movie plays and the ball flies apart. On the last frame of the movie, type the code to make the ball disappear.

Hope this makes sense.

anilin
09-06-2008, 06:38 AM
thank you, I think I get it. But how we can do like make the ball is flying and getting smaller. Then if user click ball, it will break into half and dissappear. I really appreciate you help, thanks a lot :)

neilmmm
09-06-2008, 10:36 PM
does this help

var xspeed:Number = 7;
var yspeed:Number = 5;
ball_mc.onEnterFrame = function() {
this._x += xspeed;
this._y += yspeed;
trace(this._y);
if (this._x<0 || (this._x+this._width)>550) {
xspeed *= -1;
}
if (this._y<0 || (this._y+this._height)>400) {
yspeed *= -1;
}
ball_mc.onRelease = function() {
this.play();
};
};

see fla