Y
Yoflaines
Guest
Hi, I'm currently making a top down stealth game, nothing big, got some of the mecanics working but im trying to fix a small issue I've had. My views are 640x360 if anyone wants to know. The cursor system I have is that the cursor moves with the player and it works fine untill I move outside the view and the camera follows my character, the cursor get extra "speed" to the direction im moving, it works fine in the default view. Also my system works fine when i have it in windowed but if i scale the window or go in to fullscreen the "speed" of the cursor also goes up. I'll post some code to show what I do to move the cursors around corresponding to the players movement.
The movespeed just equals the players speed so they are the same and wont move when I'm colliding with something
Code:
if keyboard_check(ord("A"))
{
x -= movespeed
display_mouse_set(display_mouse_get_x()-movespeed,display_mouse_get_y())
}
if keyboard_check(ord("D"))
{
x += movespeed
display_mouse_set(display_mouse_get_x()+movespeed, display_mouse_get_y())
}
if keyboard_check(ord("W"))
{
y -= movespeed
display_mouse_set(display_mouse_get_x(), display_mouse_get_y()-movespeed)
}
if keyboard_check(ord("S"))
{
y += movespeed
display_mouse_set(display_mouse_get_x(), display_mouse_get_y()+movespeed)
}