hey! i have started to make a game, nothing to complicated. so far i am using two squares just to test it out. i have two dynamic text boxes, one for health and one for score. i also have a little bar which width is equal to the _root.health part. my code
_root.health = 100;
_root.score = 0;
if (_root.health<=0) {
gotoAndStop(2);
}
stop();
this code is on the first frame off my game. on one of my squares i have the following code (its just to test for the health and score btw)
onClipEvent (enterFrame) {
if (Key.isDown(Key.DOWN)) {
this._y += 5;
} else if (Key.isDown(Key.RIGHT)) {
this._x += 5;
}
if (this.hitTest(_root.box)) {
_root.box.removeMovieClip();
_root.score += 1000;
_root.health -= 30;
stop();
}
}
now i have made another frame so that my intention is if the health is less than or equal to 0 it will go to it, but it doesnt. can somebody please help me or point me in the right direction? any help would be much appreciated
~binime