Hello there! I'm working at a new game and i have a little problem..
program MousTestProgram;
uses Crt, Dos, Graph;
var graphicsdriver,graphicsmode,errcode:integer;
procedure ResetMouse;
var regs : registers;
begin
FillChar (regs, SizeOf(regs), 0);
regs.ax := $0000;
Intr ($33, regs);
if regs.ax <> $FFFF then begin
writeln ('hardware/driver not installed');
halt;
end;
end; (* ResetMouse *)
procedure ShowMouseCursor;
var regs : registers;
begin
FillChar (regs, SizeOf(regs), 0);
regs.ax := $0001;
Intr ($33, regs);
end; (* ShowMouseCursor *)
procedure HideMouseCursor;
var regs : registers;
begin
FillChar (regs, SizeOf(regs), 0);
regs.ax := $0002;
Intr ($33, regs);
end; (* HideMouseCursor *)
procedure GetMouseCursor (var row, column, button : word);
var regs : registers;
begin
FillChar (regs, SizeOf(regs), 0);
regs.ax := $0003;
Intr ($33, regs);
row := regs.dx div 8;
column := regs.cx div 8;
button := regs.bx;
end; (* GetMouseCursor *)
procedure PutMouseCursor (row, column : word);
var regs : registers;
begin
FillChar (regs, SizeOf(regs), 0);
regs.ax := $0004;
regs.dx := 8 * row;
regs.cx := 8 * column;
Intr ($33, regs);
end; (* PutMouseCursor *)
procedure TEST;
var row, col, but : word;
begin
repeat
GetMouseCursor (row, col, but);
if (row>9) and (row<22) and (col>17) and (col<31) and ((but=1) or (but=2) or (but=3)) then
begin line(170,100,230,160);
line(170,160,230,100);
until KeyPressed;
end;
procedure cage;
begin line(250,80,250,390);
line(350,80,350,390);
line(150,180,450,180);
line(150,280,450,280)
end;
begin
graphicsdriver:=detect;
initgraph(graphicsdriver,graphicsmode,'E:\BP\BGI');
errcode:=graphresult;
if graphresult<>grok then
begin clrscr;
writeln('ERROR ',grapherrormsg(errcode));
writeln('noob');
readln;
halt(1);
end
else
begin cage;
ResetMouse;
ShowMouseCursor;
PutMouseCursor (12, 39);
TEST;
HideMouseCursor;
end;
closegraph
end. (* MousTestProgram *)
this is the code, and here's the problem: i press click somewhere near the x that'll be formed and i move the mouse it will leave space at the lines, and if i press again and again and again it won't leave a space again... so i want to know... what do i have to do at this program so that it won't leave a space if i press click near the x that'll be formed?