How can I check if the mouse button is released, and THEN execute a procedure once in Borland Pascal
- by Robert
Hi! I use Borland Pascal 7.0, and I would like to make a slots game (If 3 random numbers are the same, you win). The problem is that when I click on the start (Inditas) button on the menu, the procedure executes many times until I release the mouse button. I was told that I should check if the mouse button is released before executing the procedure once. How can I do that? Here's what the menu looks like:
procedure eger; begin; mouseinit;
mouseon; menu; repeat
getmouse(m); if (m.left) and
(m.x60) ANd (m.x<130) and (m.y120)
and (m.y<150) then
teglalap(90,90,300,300,blue); if
(m.left) and (m.x60) AND (m.x<130)
and (m.y160) and (m.y<190) then
jatek(a,b,c,coin,coins);
until ((m.left) and (m.x60) ANd
(m.x<130) and (m.y240) and
(m.y<270)); end;
Thanks, Robert