; MouseZ Example ; -------------- Graphics 640,480,0,2 SetBuffer BackBuffer() ; Weapon rack for the scroll-wheel selector Dim weapon$(3) weapon$(0)="Blaster" weapon$(1)="Spread gun" weapon$(2)="Laser" weapon$(3)="Rockets" While Not KeyDown(1) Cls ; MouseZ returns the mouse wheel position: it starts at 0 and ; counts up as the wheel rolls away from you, down towards you. wheel=MouseZ() ; Wrap the wheel position onto the four weapon slots slot=wheel Mod 4 If slot<0 Then slot=slot+4 ; Draw the weapon rack, highlighting the selected slot For i=0 To 3 If i=slot Then Color 255,220,0 Rect 80+i*130,200,110,60,True Color 0,0,0 Else Color 90,90,90 Rect 80+i*130,200,110,60,False Color 255,255,255 End If Text 135+i*130,230,weapon$(i),True,True Color 255,255,255 Next Text 0,0,"Roll the mouse wheel to change weapon Esc: exit" Text 0,20,"MouseZ() = "+wheel+" selected slot: "+slot+" ("+weapon$(slot)+")" Flip Wend End