ok look at this
this is the code of the workshop 14
i modify it for my effect, i want in my shooter the crosshair moves a little bit in the center of the screen
when i turn left i want the crosshair follows a little bit
and the same with right up and downward
i dont want the mouse run over the full screen
this is the code
////////////////////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>
////////////////////////////////////////////////////////////////////
BMAP* cursor_pcx = "cursor.pcx";
BMAP* crosshair_pcx = "crosshair.pcx";
////////////////////////////////////////////////////////////////////
function change_mouse_mode()
{
mouse_mode += 1;
mouse_mode %= 3;
if (1 == mouse_mode)
mouse_map = crosshair_pcx;
if (2 == mouse_mode)
mouse_map = cursor_pcx;
}
function main()
{
video_screen = 1;
video_mode = 9;
level_load ("work14.wmb");
on_m = change_mouse_mode;
while (1)
{
mouse_pos.x = clamp(mouse_cursor.x + 200, 200, screen_size.x - 200);
mouse_pos.y = clamp(mouse_cursor.y + 200, 200, screen_size.y - 200);
camera.pan -= mouse_force.x;
camera.tilt += mouse_force.y;
wait (1);
}
}
//////////////////////////////////////////////////////////////////////////////
please youse this code for the workshop 14
and try it with different video mode
you would see when you turn from left to right everything is allright
but if you turn from right to left the mouse will hang for a short time
please try and tell me why