Be a Supporter!
JesseT
JesseT
  • Member since: Sep. 12, 2008
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Mouse Maze Game? Dec. 15th, 2009 @ 05:48 PM Reply

I 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?

BillysProgrammer
BillysProgrammer
  • Member since: Sep. 17, 2008
  • Offline.
Forum Stats
Member
Level 16
Gamer
Response to Mouse Maze Game? Dec. 15th, 2009 @ 06:13 PM Reply

They do not need to be buttons, point said. Should be easy from there.

JesseT
JesseT
  • Member since: Sep. 12, 2008
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Response to Mouse Maze Game? Dec. 15th, 2009 @ 06:21 PM Reply

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?

BabiesAteMyDingo
BabiesAteMyDingo
  • Member since: Oct. 28, 2009
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to Mouse Maze Game? Dec. 15th, 2009 @ 06:21 PM Reply

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. ;)


EGB || NGPD || ART || NG SIG MAKER || WI/HT REGULAR ||

BBS Signature
47times
47times
  • Member since: Mar. 18, 2009
  • Offline.
Forum Stats
Member
Level 21
Animator
Response to Mouse Maze Game? Dec. 15th, 2009 @ 07:31 PM Reply

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?


BBS Signature
JesseT
JesseT
  • Member since: Sep. 12, 2008
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Response to Mouse Maze Game? Dec. 15th, 2009 @ 07:54 PM Reply

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...

JesseT
JesseT
  • Member since: Sep. 12, 2008
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Response to Mouse Maze Game? Dec. 15th, 2009 @ 08:46 PM Reply

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?

teknoZombi
teknoZombi
  • Member since: Dec. 14, 2009
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to Mouse Maze Game? Dec. 15th, 2009 @ 10:25 PM Reply

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.


Thanks BabiesAteMyDingo for the sig!

BBS Signature
ExplicitSpontaneous
ExplicitSpontaneous
  • Member since: Dec. 16, 2009
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to Mouse Maze Game? Dec. 16th, 2009 @ 08:08 AM Reply

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.


BBS Signature
JesseT
JesseT
  • Member since: Sep. 12, 2008
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Response to Mouse Maze Game? Dec. 16th, 2009 @ 08:55 PM Reply

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?