ok, i’m making an arkanoid/breakout/brickles game and i need help.
I got the score counter working, i got the movement and everything working, but how do i make it so that if a variable is lower than 1(in this case, lives), it goes to another frame(which is the gameover screen).
onclipevent(enterframe) {
if(lives==0) {
gotoAndPlay(2);
}
}
or something like this, just a quick start
yes, that’s probably what i wanted but there’s one problem. “onClipEvent (enterFrame)”–>do i have to put this on a movie clip?
no, you can take out the first and last lines and put it on the timeline
hmm…doesn’t seem to work…i probably did something wrong.
When you decrease the variable, check its value. No need to put it in an enterFrame
omg it still doesn’t work. i’ll post up the fla and please help me.(note: this version i have not put up the (lives==0)…)
function wall_down() {
if ((newy+radius)>=screenBottom) {
_root.lives=_root.lives-1;
if (_root.lives < 1) {
trace ("End of the Game") ;
this._parent._parent.gotoAndStop(2) ;
}
reactV();
}
}
But you’ll also have to get rid of everything you’ve attached on the screen.
By the way, very nice game
Yo thanks man(also to you bombingpixels) iT’S so cool. now all i need to do is stop the ball from moving after the gameover pops up.
hey do i really need that “trace” command? cause all it does is create an output. it works fine without it.
I made it so that if you lose the game, the ball is removed so you can’t get anymore points, i just need to bring the “gameover” textbox to the front. Any way to do that?
Put the textbox into a Movie clip and use a swapDepth(x) where x is a higher number than all the other clips depths on your screen. Or a MovieClip.getNextHighestDepth() might also work.
Trace command isn’t needed for the code to work. It’s just for debugging. If you got many traces all over your code you can also say Omit trace actions in the publish settings and it will filter the traces out when compiling.
k thx drcolossus
now i’m wondering how can i make more levels. for example when the first level is finished, you create another and keep on looping.