Page 1 of 1

Help with Maze walls

PostPosted: Mon Nov 21, 2005 7:37 pm
by MrJoe
Hello, I am attempting to make a simple game where you move a ball through a maze using your mouse or stylus.
I'm having some trouble getting the mouse to "let go" of the ball when the ball collides with the wall of the maze.
The result is that the ball disappears from one side of the wall and appears on the other, following the mouse.

Is there a way to "let go of" an actor when it collides with a wall, allowing the curser to move about freely
and still be able to "pick up" that actor by mousing over, or clicking on it?

PostPosted: Mon Nov 21, 2005 9:16 pm
by willg101
Just use the "drag" option on event > mouse down > action > script editor > //
HTHs, hope you understand what I mean.

PostPosted: Mon Nov 21, 2005 9:57 pm
by MrJoe
Thanks so much im at work now, but ill try it when i get home :P

PostPosted: Tue Nov 22, 2005 3:15 am
by MrJoe
Just use the "drag" option on event > mouse down > action > script editor > //
HTHs, hope you understand what I mean.


Almost there. This lets me pick up and drop the ball at will, however it still follows the curser as you move it about the sreen. I need a way to force the ball to be confined by the walls of the maze.

Currently i have a Physical Response action in place that gives the walls mass, but the ball is still able to "break through" the wall in order to follow the mouse, obviously this is unacceptable as the player could simply drag the ball directly through the walls to the goal.

Any help or ideas woud be GREATLY appreciated.

PostPosted: Sun Nov 27, 2005 3:16 am
by MrJoe
Ok, I am able to make my "maze" work using keyboard input (and quite well I must add) however, I would REALLY like to get it to work using a mouse/stylus.

I can "pick up" and move the curser with the mouse, my problem is the curser actor "pops through" the walls, If i could force the mouse to drop the curser on impact with the wall, but still retain the ability to click/drag the curser i would be in business.

I'm sure there is a simple solution and Im just not seeing it. If any one has ANY ideas I would be very grateful.

PostPosted: Sun Nov 27, 2005 9:22 am
by Novice
Try using the move to function. Your actor will follow the mouse but it will stop when it hits something. You should try using a lower velocity that should make it less likley to jump thru walls. And maybe you could put a distance function betwen the mouse and the actor so when it is too far away the player stops folowing. And one more thing i dont know why but the move to f. dosent work with the mouse so parent an inviseble actor to the mouse and use "move to" on it.
I havent tried it out so im not sure if it will work but i hope it helps.

PostPosted: Sun Nov 27, 2005 8:18 pm
by MrJoe
Thank you!

PostPosted: Sun Nov 27, 2005 9:42 pm
by Novice
No prob. Just remember to think outside of the box :wink:

PostPosted: Mon Nov 28, 2005 8:40 am
by ondy1985
Novice wrote: i dont know why but the move to f. dosent work with the mouse so parent an inviseble actor to the mouse and use "move to" on it.
I havent tried it out so im not sure if it will work but i hope it helps.

you mean that moveto( ... ,xmouse, ymouse, ...); does not work? why? It works well in my old GE... :shock:

PostPosted: Mon Nov 28, 2005 10:13 am
by Novice
Sorry bout that it works, i got confused :oops:, it dosent work when you try to get the angle betwen an actor and mouse and put directional_velocity to the actor it just flies of in some random direction, dont know why maybe i was doing something wrong.
Here is my code
Code: Select all
angle= direction(actor.x,actor.y,xmouse,ymouse);
directional_velocity=3;

It works well when i use a parented actor to the mouse.