I know mouse.where exists, I have used it before...but all FPS games have the mouse rooted to a certain area on the screen (including turing games on this site) because this is a more accurate (IMO) way to do it for a game that relies heavily on mouse precision.
Tony
Posted: Sun Nov 13, 2011 8:38 pm Post subject: RE:Cursor location for crosshair
For that to work, you'd need to get the OS to not move the mouse cursor, and have it send mouse displacement events, rather than current location. As far as I remember, Turing is unable to do either.
The behaviour can sort of be emulated as long as the mouse doesn't leave the active window. Meaning no 360 degree turns (one could up the sensitivity, but that would only linearly increase the max turn amount)
Posted: Sun Nov 13, 2011 9:12 pm Post subject: Re: RE:Cursor location for crosshair
Tony @ 13/11/2011, 7:55 pm wrote:
[citation needed]
*Facebook Like*
Sponsor Sponsor
Zren
Posted: Mon Nov 14, 2011 12:10 am Post subject: RE:Cursor location for crosshair
Someone did do a 3D FPS game with 3D text, but he did not capture the mouse. He did do a pretty good job within his limits however.
I was more annoyed at the fact he did procs for each letter than trying to load a polygon file.
elDoRado
Posted: Mon Nov 14, 2011 7:07 am Post subject: RE:Cursor location for crosshair
I appreciate it,
Like, what I had inmind was
cursor location, than 4 bars, 3x16 black,
and 2 verticals and 2 horizontals, and i would determine placing by mouse location
for ie: x, y <mouse locations
crosshair A- the top 1
xvalue = x
yvalue = y + 5 to move it 5 above.. see where i'm coming from? :/
I'm only a grade 11 student..
evildaddy911
Posted: Mon Nov 14, 2011 8:04 am Post subject: Re: Cursor location for crosshair
if you want to make the crosshairs start at the center of the screen, then make a variable that stores the mouse's location when the game starts, then use mousewhere to detect where the mouse is in relation to the initial values:
Turing:
var initialx, nowy, nowx, relatedy, mx, my, mb :int
mouse.where(mx, my, mb)
initialx := mx
initialy := my
Posted: Mon Nov 14, 2011 2:11 pm Post subject: RE:Cursor location for crosshair
I know what a procedure is, what's a polygon file?
evildaddy911
Posted: Mon Nov 14, 2011 2:30 pm Post subject: Re: Cursor location for crosshair
i think a better idea than the initialx,nowx would be
Turing:
var x,y,b:int
proc crosshair (x, y :int) drawoval(x, y, 10, 10, black) drawline(x, y + 10, x, y - 10, black) drawline(x - 10, y, x + 10, y, black) end crosshair
crosshair (maxxdiv2, maxydiv2) loop mousewhere(x,y,b) exitwhen x=maxxdiv2and y=maxydiv2%stops program until the mouse is in the center of the play area endloop
% main loop loop mousewhere(x,y,b)
crosshair(x,y) endloop