Ultimate Gear War
Join the alien war, prepare your gear and protect your base at all cost!
4.25 / 5.00 13,067 ViewsI am making a mouse maze game and I have made the mazes but I have tried to make Moving enemies but since They need To be buttons to make you lose when you hit them, how do I make the button move?
They do not need to be buttons, point said. Should be easy from there.
At 12/15/09 06:13 PM, BillysProgrammer wrote: They do not need to be buttons, point said. Should be easy from there.
The Action Script I use is on(rollOver){gotoAndPlay(3);} and when I use it on a Movie Clip when the mouse hits the guy nothing happens?
Just to expand on that point.
You'll find this a lot easier by using hit tests. You'll have to tell us what version of ActionScript you wish to use in order to get the best help.
But if you tween (be it by motion or by scripting) some enemy MovieClips. By then testing, using an enterframe function, you could then implement a hit test function to see if the mouse has hit one of the enemies.
Once it has, you could then use a flag, or boolean to trigger an event that occurs, once the mouse does come into contact with an enemy. Such as a loosing screen, or a lose of a life.
Sorry if thats really confusing. ;)
Hey I got a question, if you ad a movie clip to a button, will the hit move like the movie clip does? or will it stay in the same position?
At 12/15/09 07:31 PM, 47times wrote: Hey I got a question, if you ad a movie clip to a button, will the hit move like the movie clip does? or will it stay in the same position?
I tried that and when I hit the guy nothing happens...
At 12/15/09 06:21 PM, BabiesAteMyDingo wrote: Just to expand on that point.
You'll find this a lot easier by using hit tests. You'll have to tell us what version of ActionScript you wish to use in order to get the best help.
Hey do you know where I can find A tutorial on that so I can finish the enemies?
if you are ok with the enemies being movieclips you can try detecting the mouse's coordinates. like if the mouse's x and y = your enemy's x & y then they lose a life or whatever.
I don't get your problem. Once you've created youe enemies, click on them, press F9 (actions panel) and enter the following code:
on(rollOver) {
gotoAndStop("Losing Screen");
}
When you "rollOver" the enemies, the game will take you to a losing screen.
[it can be a frame or a seperate layer; if it is a frame, the code will look like this:]
on(rollOver) {
gotoAndStop(2);
}
You can also use traces to check if your code works. Traces look like this:
trace("My code works!");
Hope this helped.
At 12/16/09 08:08 AM, ExplicitSpontaneous wrote: I don't get your problem. Once you've created youe enemies, click on them, press F9 (actions panel) and enter the following code:
on(rollOver) {
gotoAndStop("Losing Screen");
}
When you "rollOver" the enemies, the game will take you to a losing screen.
[it can be a frame or a seperate layer; if it is a frame, the code will look like this:]
on(rollOver) {
gotoAndStop(2);
}
You can also use traces to check if your code works. Traces look like this:
trace("My code works!");
Hope this helped.
Yeah this works if the enemy is a button, but then I can make the button move and if I apply the code to a movie clip when I rollOver nothing happens?? Also I am not sure what to do for that trace thing?