Help with Maze walls

Talk about making games.

Help with Maze walls

Postby MrJoe » Mon Nov 21, 2005 7:37 pm

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?
User avatar
MrJoe
 
Posts: 13
Joined: Sun Aug 14, 2005 4:39 pm
Location: Long Island
Score: 0 Give a positive score

Postby willg101 » Mon Nov 21, 2005 9:16 pm

Just use the "drag" option on event > mouse down > action > script editor > //
HTHs, hope you understand what I mean.
http://www.wish-games.com
Old betas now available!!
User avatar
willg101
 
Posts: 473
Joined: Thu Dec 16, 2004 12:08 am
Location: West Michigan
Score: 5 Give a positive score

Postby MrJoe » Mon Nov 21, 2005 9:57 pm

Thanks so much im at work now, but ill try it when i get home :P
User avatar
MrJoe
 
Posts: 13
Joined: Sun Aug 14, 2005 4:39 pm
Location: Long Island
Score: 0 Give a positive score

Postby MrJoe » Tue Nov 22, 2005 3:15 am

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.
User avatar
MrJoe
 
Posts: 13
Joined: Sun Aug 14, 2005 4:39 pm
Location: Long Island
Score: 0 Give a positive score

Postby MrJoe » Sun Nov 27, 2005 3:16 am

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.
User avatar
MrJoe
 
Posts: 13
Joined: Sun Aug 14, 2005 4:39 pm
Location: Long Island
Score: 0 Give a positive score

Postby Novice » Sun Nov 27, 2005 9:22 am

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.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby MrJoe » Sun Nov 27, 2005 8:18 pm

Thank you!
User avatar
MrJoe
 
Posts: 13
Joined: Sun Aug 14, 2005 4:39 pm
Location: Long Island
Score: 0 Give a positive score

Postby Novice » Sun Nov 27, 2005 9:42 pm

No prob. Just remember to think outside of the box :wink:
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby ondy1985 » Mon Nov 28, 2005 8:40 am

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:
Image

Motto: "I never let my schooling interfere with my education" --- Mark Twain
User avatar
ondy1985
 
Posts: 99
Joined: Thu May 05, 2005 7:43 pm
Location: Slovakia
Score: 1 Give a positive score

Postby Novice » Mon Nov 28, 2005 10:13 am

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.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron