-
[MX] Mouse Movement Collision
You know those games where you press up and down and your guy stops going up if he hits the top wall and the same for the bottom wall? That's what I'm trying to do but with the mouse. Right now I'm trying to make just the top wall. I came up with this and once the guy hits the wall he stops moving.
PHP Code:
move=true;
onEnterFrame = function() {
if (move==true) {
guy._x=_xmouse;
guy._y=_ymouse;
}
if (guy.hitTest(wall)) {
move=false;
}
}
I don't know how to do it.
-
Senior Member
I think a far better idea would be to restrict the movement of mouse within the region of walls i.e. pre-define the drag area for the movement.....
Check the attached sample.....apply drag constraints!!!
Last edited by vinayak.kadam; 08-28-2008 at 02:52 AM.
As ever,
Vinayak Kadam
-
I couldn't open that file, only the executable. I use Flash MX and AS2. Maybe you could post the codes for one of the bottles?
-
Also I want the guy to move with the mouse, I don't want to drag him.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|