I’m sorry for yet another script question, but here it comes.
I’m making a game, and i have set a dynamic textbox “life” with var “life” and it works like this.
In frame 21 of an MC(so not on the main scene) , I have this code:
_root.life -= 1;
to make that, if you reach this frame(it’s a shooter, if you shoot quick enough, you won’t reach it) your life goes -1
In Frame 1 of a layer, I have this code:
_root.life = 50;
to make that you have 50 life when you start the game
That worked well, but now I’m getting to the problem.
In frame 1 of another layer, I inserted this code:
if root.life = 0;
gotoAndPlay(frame2)
(frame2 is a “Game Over” screen)
I changed a lot of stuff to try, but it always gives errors.
What is wrong?
you didnt put a underscore on the root, sometimes simple things like this mess up our code and we spend hours trying to find out whats wrong trust me it hapens to me all the time :S
Very strange…
With that new code, it doesn’t give any errors, but it doesn’t work, and I don’t start with 50 life, although there is
_root.life =50;
in another layer.
Very strange…
An attachement’s max sixe is 15 000 bytes.
My movie is 150 000 bytes. After I WinZipped it, it was 76 000 bytes. If I delete a few stuff, I can get it down to 70 000 bytes.
But how can I post it on kirupa?
PS If you still now how to solve the if _root.life stuff,please teel me!