How can I check if the mouse button is released, and THEN execute a procedure once in Borland Pascal

Posted by Robert on Stack Overflow See other posts from Stack Overflow or by Robert
Published on 2010-04-04T18:58:00Z Indexed on 2010/04/04 19:03 UTC
Read the original article Hit count: 283

Filed under:
|
|
|

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.x>60) ANd (m.x<130) and (m.y>120) and (m.y<150) then teglalap(90,90,300,300,blue); if (m.left) and (m.x>60) AND (m.x<130) and (m.y>160) and (m.y<190) then jatek(a,b,c,coin,coins);

until ((m.left) and (m.x>60) ANd (m.x<130) and (m.y>240) and (m.y<270)); end;

Thanks, Robert

© Stack Overflow or respective owner

Related posts about borland

Related posts about pascal