-
Ending a Level
There are quite a few tutorials on this, but my question wasn't in any of those tutorials. For those of you that have played NinjaGame (NGame). I want to make something similar to how they end each level on there.
On my game I have a ball, and when it collects the finish 'coin' I want the whole level to stay there, but I don't want the ball to be able to move when it touches the coin.
If you don't know what I mean then please take a look at NGame:
http://entertainmentfans.com/ngame/
When the ninja hits the door then the whole level freezes and he does a little dance. I want this same effect but with a ball hitting a coin (and no dance). Is there a way to restrict movement after the ball hits the coin? I imagine this is a hitTest right? If you don't know what I mean just tell me and I'll try my best to clarify. If it helps I'm using MX and AS2.0
-
assuming both symbols have the instance names 'ball' and 'coin' and that they are both sitting on the same timeline, this statement should be an example of what you're after:
Code:
this.onEnterFrame = function() {
if (this.ball.hitTest(this.coin)) {
delete this.onEnterFrame;
} else {
// your moving ball function here
}
};
gparis