-
[F8] Game Pause - Help!
Hi, Again!
Like i said, im making a new game named: Space Attacker
The whole thing is to avoid the enemies... The enemies are MC, and im tweening them around the area!
THe Avoider is the MOUSE! So you'll have to avoid the enemies by moving the mouse... I putted a script on a MC.. So the MC became the mouse...
The Problem:
Everyone can just take the mouse out of the screen/.swf file...
And just CHEAT! That bad... And my question is: How can i do, that if the mouse gets out of the screen/swf file, the game will automatic pause.... ???:confused:
-
You can't check whether the mouse leaves the swf using coordinates, the only way that I know of is by having a stage-wide movieclip, and add onRollOver/onRollOut events. The problem is that if you have any other buttons, they will trigger an onRollOut on the big button when you roll over them, so you have to make sure all your other code takes this into account.
-
Actually if they leave the swf, the "real" mouse should still be at the edge where they left, leaving them vulnerable to enemies and such. The really cheat is when they come back in on the opposite side of swf, and the mouse "snaps" to that location. How I would do it is use easing of the "real" mouse to the mouse coordinates, so that there's no snapping.