PDA

View Full Version : help with hitTest



Zidane_ffs
June 30th, 2003, 04:23 AM
Hey ppl

I'm trying to create a game (soughta like Zelda, ya walk around and kill things) but I'm having some trouble with hitTest

When my character walks to a certain movieclip (a movie clip titled 'area') its supposed to go to the next frame, but its not. Can anyone help me with the scripting for this?

Cheers

Dravos
June 30th, 2003, 06:30 AM
You can draw your level on one layer. Put your character on this level also, in a movie clip.

Then on a seperate layer, draw lines where you want your character to stop, a sort of outline of the level. Make this a movieclip also


Then you do a hitest whenever the character movieclip moves, and the object to test is the outline movieclip.

I have seen this done somewhere...Ill try and remember where...

Regards,

Dravos

Dravos
June 30th, 2003, 06:39 AM
Heres the link, its an open source zelda thing, but the code looks like what you want...

http://www.marmotte.levillage.org/_html/_flash_games/zelda_open.html

Zidane_ffs
June 30th, 2003, 08:57 AM
Cool, thanx for the help

Zidane_ffs
June 30th, 2003, 10:10 AM
I've been messing around with it but I cant seem to get what I need
Not only did I need a way to set boundry's but I need a way in which by hitting a certain coordinate or movieclip the movie goes to the next frame

Any ideas?

Cheers

Zidane_ffs
June 30th, 2003, 10:52 AM
Righty o

i'm having some problems with my game im making. So far In it I have a character, that can be moved by the keys, and a desk, which the character is supposed to walk to and pick up the guns on it.

Now my problem is I have a moveclip (an invisible black square) on one layer and the character on another layer. I've used the hitTest function telling it that when the character hits the black square to go to the next frame but, of course, the bloody movie does stuff all

any help with understanding how to use the hitTest properly would be great

Cheers

PS. If ya want the .fla to see what the hell im talking bout i'll be happy to send it

Jubba
June 30th, 2003, 11:18 AM
http://www.kirupa.com/developer/actionscript/hittest.htm

there is a hitTest tutorial. If you need more help once you are finished with that, then post. :)

Zidane_ffs
June 30th, 2003, 06:28 PM
Yeah I've seen that tutorial already but I still can't get the **** thing to work

Sorry bout the trouble, Im a newbie to actionscript

Cheers

Flash monkey
July 1st, 2003, 03:25 PM
im not shore if this is to late but ill give it a go anyway here is some very basic hitTest

onClipEvent (enterFrame) {
if (this.hitTest(_root.object)) {
_root.gotoAndStop(3);
}
}