Here's some code that creates a sort-of "Lunar Lander" type situation. Use the joystick to apply spurts of force to the lander (just a ball for this demo).
This code needs no media.
SetVirtualResolution(640,480)
SetClearColor(155,155,255)
AddVirtualJoystick (1, 50, 430, 100)
groundSpr = CreateSprite(0)
SetSpriteSize(groundSpr, 640, 100)
SetSpritePosition(groundSpr, 0, 380)
SetSpriteShape(groundSpr, 2)
SetSpritePhysicsOn(groundSpr, 1)
hillSpr = CreateSprite(0)
SetSpriteSize(hillSpr, 320, 240)
SetSpritePosition(hillSpr, 320, 300)
SetSpriteAngle(hillSpr, 45.0)
SetSpriteShape(hillSpr, 2)
SetSpritePhysicsOn(hillSpr, 1)
ballImg = LoadImage("JoystickInner.png")
ballSpr = CreateSprite(ballImg)
SetSpritePosition(ballSpr, 320, 0)
SetSpriteOffset(ballSpr, GetSpriteWidth(ballSpr)/2, GetSpriteHeight(ballSpr)/2)
SetSpriteColor(ballSpr, 255, 255, 100, 255)
SetSpriteShape(ballSpr, 1)
SetSpritePhysicsOn(ballSpr, 2)
SetSpritePhysicsRestitution(ballSpr, 0.5)
SetSpritePhysicsFriction(ballSpr, 10.0)
do
x# = GetVirtualJoystickX(1)
y# = GetVirtualJoystickY(1)
Print(str(x#,1)+"/"+str(y#,1))
if x# > 0.2
SetSpritePhysicsForce(ballSpr, GetSpriteXByOffset(ballSpr), GetSpriteYByOffset(ballSpr), 20000.0, 0)
endif
if x# < -0.2
SetSpritePhysicsForce(ballSpr, GetSpriteXByOffset(ballSpr), GetSpriteYByOffset(ballSpr), -20000.0, 0)
endif
if y# < -0.2
SetSpritePhysicsForce(ballSpr, GetSpriteXByOffset(ballSpr), GetSpriteYByOffset(ballSpr), 0, -20000)
endif
Sync()
loop
EDIT: Soulstealer, I took the basic idea a step further,
here.