home *** CD-ROM | disk | FTP | other *** search
/ Amoszine 3 / Amoszine 3.adf / sticks_ext / sticks-demos / Forbidden-Mouse.AMOS / Forbidden-Mouse.amosSourceCode < prev    next >
Encoding:
AMOS Source Code  |  1992-02-26  |  1.0 KB  |  37 lines

  1. ' A Demo to show off Mouse X() and Mouse Y() in a Forbid.  
  2. ' Note: Ctrl+C does not work from a Forbid.
  3. '       Forbids and Permits stack up so if you have 2 Forbids  
  4. '       You will need to Permits.
  5.  
  6. Screen Open 0,640,256,4,Hires
  7. Wait Vbl 
  8.  
  9. ' The Mouse Clip 0 limit the Sticks mouse 0 to the whole screen  
  10. ' if you want it limited to part of a screen you could use 
  11. ' Mouse Clip 0,128,50 to 320,140.  
  12.  
  13.  Extension_17_0116 0
  14. Limit Mouse 
  15. Double Buffer 
  16. FBID=False
  17. Get Sprite Palette 
  18. Flash Off : Curs Off : Cls 0 : Paper 0
  19. Centre "Press Left To Forbit & Right To Permit"
  20. Do 
  21.    X= Extension_17_00DA(0) : Y= Extension_17_00F4(0)
  22.    Sprite 1,X,Y,1
  23.    Bob 1,X Screen(X Mouse)+18,Y Screen(Y Mouse),2
  24.    Bob 2,X Screen(X)+18,Y Screen(Y),3
  25.    If Extension_17_011E(0)=1 and FBID=False
  26.       FBID=True
  27.       I=Execall(-132) : Rem Forbid 
  28.       Pen 2
  29.       Locate ,2 : Centre "This is a Forbid Situation"
  30.    End If 
  31.    If Extension_17_011E(0)=2
  32.       If FBID=True
  33.          I=Execall(-138) : Rem Permit 
  34.       End If 
  35.       End 
  36.    End If 
  37. Loop