-
ive made a rtype style game with 2 scenes
"level1" and "level2"
1 spaceship..1 duplicated enemy...1 pikupitem..laser and a variable score in a dynamic text field
my problem is that i want the movie to go to scene2 when a specific score is hit here is the script for the laser cause thst is where the score is worked out any help would be muuch appreciated :)onClipEvent (load) {
score=0;
laserMoveSpeed = 75;
this._y = _root.spaceship._y;
this._x = _root.spaceship._x+50;
}
onClipEvent (enterFrame) {
this._x += laserMoveSpeed;
if (this._x>=700) {
_root.spaceship.lasercounter--;
this.removeMovieClip();
}
for (i=1; i<=_root.numEnemy; i++) {
if (this.hittest(_root["enemy1"+i])) {
_root["enemy1"+i].gotoAndPlay(2);
_root.score+=200;
this.removeMovieClip();
} else {
if (_root.score>=500) {
_root.gotoAndPlay("level2");
}
}
}
if (this.hittest(_root.enemy)) {
_root.enemy.gotoAndPlay(2);
_root.score+=200;
this.removeMovieClip();
} else {
if (_root.score>=500) {
_root.gotoAndStop("level2",1);
}
}
}
-
hehe - cool name... luckily my nick wasn't reserved when i registered :)
i think you should remove the else statements from your code. i can't figure out why "else" is useful here, if it is tell me why so that i can review the code with your ideas in mind.
Yours
HTD
-
I've made almost the same thing and i resolved my problem with a tellTarget like :
tellTarget ("_level0") {
gotoAndStop ("level2", 1);
}
I hope this will help you.