ForumsProgramming ForumNewbie! :) Need some help

3 2940
noello
offline
noello
1 posts
Nomad

Hi there folks

I'm a newbie at flash programming, to be honest, I can't do much at all. And I'm trying to make a simple funny game for a friend.

What I need help with is this:

I have a character I can move around on the screen with the keyboard.
And what i want is that when this character hits a point (lets say a door), i want the game to go to the next frame. I have read alot of treads, and i'm guessing it has something to do with hittest, but i can't manage to do this.
Yeah, i know it can be done in different ways and have more rooms, but i really want it to go to the next frame when the movieclip is over a certain point on the game.

Please help meeee

  • 3 Replies
gluesy
offline
gluesy
65 posts
Nomad

if(hitTest(_root.door)){
_root.gotoAndPlay(2);
//note that you can use nextFrame or prevFrame instead of gotoAndPlay
}


If your using as3 you have to use hitTestPoint and there are three parameters involved also you have to specify what you want to check hiting with the door.

if(door.hitTestPoint(character.x,character.y,false)){
gotoAndStop(2)
}

The true or false value indicates whether you want to hit test the movie clips bounding box its actual shape. Use true if you want more accurate collision detection.
gluesy
offline
gluesy
65 posts
Nomad

The true or false value indicates whether you want to hit test the movie clips bounding box its actual shape. Use true if you want more accurate collision detection.


sorry meant to say:
hit test the movie clips bounding box OR its actual shape
Showing 1-2 of 3