|
-
Prid - Outing
Hi, in order to achieve this effect, you'd need to make a boolean variable (which can either be true or false) and toggle the value as the wizard hits the white spell. Here, replace your code with this:
PHP Code:
onClipEvent(load){ hitting = false; }
onClipEvent (enterFrame) { if ((this.hitTest(_root.man))) { if(hitting == false) { _root.health.nextFrame(); hitting = true; } } else { if(hitting == true){ hitting = false; } } }
We make a boolean variable with the starting value of false. If the man is hitting the white spell, THEN we check if hitting variable is equals to false -- and all of this is true, THEN we execute the code where the health is set to go to the next frame, but we also set hitting to true, as to not repeat the same code over and over again. In the else part of the if statement, that is when the man is NOT hitting the white spell, we first check if hitting is equals to true, and if it is (which means that we've hit the spell already, but are not on it anymore), THEN we reset hitting to false -- thus continuing the cycle to achieve the desired effect 
Hope this helps ^^
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|