Does anyone know why the score is going mad in the beginning of the movie? Sorry about the messy code.
PS = The gotoandplay (2) in the “enemy” code is a frame that hasn’t been made yet. But I don’t think that influences the problem.
Does anyone know why the score is going mad in the beginning of the movie? Sorry about the messy code.
PS = The gotoandplay (2) in the “enemy” code is a frame that hasn’t been made yet. But I don’t think that influences the problem.
Anyone?
still stuck? i think i figured it out. In your laser movieclip, i changed the ‘for’ part to this:
[AS]
for (j=1; j<=_root.numEnemy; j++) {
if (this.hitTest(_root[“enemy”+i])) {
_root.score += 10;
_root[“enemy”+i].gotoAndPlay(2);
this.removeMovieClip();
}
}
[/AS]
well as you can see, its basically the same except i changed ‘i’ to ‘j’. I think the problem was you had another thing which used ‘i’ as a variable.
Oh ya, you should put all your code on the same keyframe, so its much easier to handle in the future
? The score’s normal now, but it doesn’t hitTest.
It just passes by???
What doesn’t hitTest? the bombs and the house thing? it does for me…
The lasers and helicopters don’t.
well i edited it it works now but what it was i think j was already in use i done k and it worked fine
Tried K too… Can you post the edited .fla?
yeah gimme a minute
well the fla i downloaded from you din’dt do anything on hitTest with the plane and the helicoptor…
here it is
hope this is what you wanted (if not tell me and ill try again)
It says " Unexpected file format" .
Maybe post the whole code for the laser, that’ll work I guess…
hi sorry i dint respond sooner (i was making a game of my own) but here it is
onClipEvent (load) {
laserMoveSpeed=20;
this._y=_root.vliegtuigje._y;
this._x=_root.vliegtuigje._x+20;
}
onClipEvent (enterFrame) {
this._x+=laserMoveSpeed;
if (this._x>600){
this.removeMovieClip();
}
for (k=1; k<=_root.numEnemy; k++){
if (this.hitTest( _root[“enemy”+k])){
_root.score+=10;
_root[“enemy”+k].gotoAndPlay( 2 );
this.removeMovieClip ();
}
}
}
hope this helps
First , thanks for the reply. But it still doesnt work! Now it hittests, but the score goes weird again in the beginning.
what did you want to happen when the planes hit each other? because nothing ever happend in your first file nor this one…
change _root[“enemy”+k] to:
_root[“enemy”+i] and the score doesn’t go weird…
The planes and helicopters, dont have to hittest, but the helicopters have to with the lasers (press SPACE)
sorry don’t know, but you needa organize your whole thing. Your code is EVERYWHERE. It would be easier to identify the problem if it wasn’t all spread out…
I know but it’s spread, but I’m trying to do all my code (until the fla is finished ) and then organize it.
PS= Anyone can solve it?
i know, but if you’re stuck then why not just organize eveything to find the problem so its easier for us and you?? It’ll be a pain to find it with the mess now…
yes thats true… the spaghetti code is very messy and its mind boggling
:: Copyright KIRUPA 2024 //--