; JoyY Example ; ------------ Graphics 640,480,0,2 SetBuffer BackBuffer() While Not KeyDown(1) Cls ; JoyY returns the stick's y-axis as a float from -1.0 (full up) ; to 1.0 (full down); JoyX is its horizontal partner. jy#=JoyY() jx#=JoyX() If JoyType()=0 Then Text 0,0,"Esc: exit" Text 0,60,"No joystick detected - plug in a gamepad to try this example." Text 0,80,"With one attached, the crosshair below follows the stick." Else Text 0,0,"Move the stick up and down Esc: exit" End If ; Crosshair driven by the stick (sits centred with no input) x=320+jx*220 y=240+jy*180 Color 90,90,90 Line 0,y,639,y ; horizontal marker tracks the JoyY value Color 255,255,0 Oval x-10,y-10,20,20,False Line x-14,y,x+14,y Line x,y-14,x,y+14 Color 255,255,255 Text 0,20,"JoyY() = "+jy Text 0,40,"JoyX() = "+jx Flip Wend End