mouse
#1
Posted 26 April 2012 - 09:59 AM
#2
Posted 26 April 2012 - 10:26 AM
Also if the level is too hard then how do you think the player going to do anything with the mouse jammed up (You can't do anything until you pass the level. Wahahahaha >:D)
I recommend have an object at mouse position and let the object follow the mouse.
Edited by Jlm07, 26 April 2012 - 10:27 AM.
#3
Posted 26 April 2012 - 10:31 AM
Almost like scary game maze game.
Edited by original games, 26 April 2012 - 10:32 AM.
#4
Posted 26 April 2012 - 11:01 AM
x=mouse_x; y=mouse_y;
That will set the players x and y coordinates to the x,y coordinates of the mouse
#5
Posted 26 April 2012 - 11:03 AM
#6
Posted 26 April 2012 - 11:17 AM
You obviously arent listening to me. If i set that, the player will instantly jump to wherever the mouse it. So the palyer could win the maze when he starts, if he knows where the finish is
Yeah sorry, I was more replying to the other posters comments about setting the mouse positions, and overlooked the original question. If you're wall objects are solid, you can just move towards the position of the mouse, and when you collide with the walls you'll be set back to the position before you tried moving, hence you won't be able to go through the wall. I would post a more thorough explanation, but I see FiaB is posting, so I'll probably be ninja'd
#7
Posted 26 April 2012 - 11:26 AM
x=mouse_x
y=mouse_y
Becouse the player can jump thro the wall.
#8
Posted 26 April 2012 - 11:29 AM
If i make the walls solid, it wot help at all, if i do:
x=mouse_x
y=mouse_y
Becouse the player can jump thro the wall.
"You obviously arn't listening to me", ironically.
I said if you move towards the position of the mouse, not set the position as the mouse.
direction=point_direction(x,y,mouse_x,mouse_y); speed=4;
So the player will try to move 4 pixels towards the mouse position. Then, when the player collides with the solid walls, the x and y positions are automatically set back to their previous x and y positions before the collision.
It's a simple technique, and won't be smooth, but it's a starting point.
#9
Posted 26 April 2012 - 11:31 AM
anyway.. here is one way using the diffrent position of the mouse to move the cursor
create event:
last_x=mouse_x; last_y=mouse_y;step event:
x+=mouse_x-last_x; y+=mouse_y-last_y; last_x=mouse_x; last_y=mouse_y;
but you might do it something like this:
create event:
window_mouse_set(x,y) window_set_cursor(cr_none) // or cr_crosswith the code that Soulsnatcher posted in the step event.. if you use the button method you don't even need the window_mouse_set
when you hit a wall, then do it like the flash games does:
intance_create(xstart,ystart,obj_restart_button) window_set_cursor(cr_default) instance_destroy()making a restart button where the start position was, and on mouse enter you create the cursor object again at its position while destroying the button
if you fear cheaters using drawpads to just click at the goal position, then make the cursor object do a collision check between x,y and mouse_x,mouse_y, if it finds anything between there, then restart
EDIT: and might also be an idea to check the distance between the two points aswell
.. make it possible to collect coins to buy checkpoints x3
Edited by FoxInABox, 26 April 2012 - 11:34 AM.
#10
Posted 26 April 2012 - 11:50 AM
.. make it possible to collect coins to buy checkpoints x3
Already did it
window_mouse_set(x,y)
This is what I was looking for, thx
Edited by original games, 26 April 2012 - 11:51 AM.
#11
Posted 26 May 2012 - 04:49 AM
the button is deleted and obj_nothing is changed to obj_char
then use mouse_x,mouse_y
Edited by quantumleap2099, 26 May 2012 - 04:55 AM.
#12
Posted 26 May 2012 - 04:56 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











