event.load
extern.close("{APP_NAME}") // Only one instance allowed
app.init("{APP_ID}", "{APP_NAME}", "{APP_VERSION}", "{APP_BUILD}", "{CREATE_LOG}")
window.main.canGoOut(false)
&ptr = 0
&Key = Null
&WSound[] = 11^^1^^2^^2^^1^^2^^2^^3^^4^^4^^3^^4^^4^^1^^2^^2^^1^^2^^2^^5^^6^^7^^8^^9^^10
// Load image and set the shape as an ellipse
&image = draw.mem.createFromFile(path.rsc("valse.jpg"))
&iWidth = draw.&image.width()
&iHeight = draw.&image.height()
draw.main.copyFrom.&image(0,0,&iWidth,&iHeight,0,0)
draw.main.paint()
window.main.shape.elliptic(1,1,&iWidth-2,&iHeight-2)
window.main.pos.now(screen.width()/2-&iWidth/2, screen.height()/2-&iHeight/2, &iWidth-2,&iHeight-2)
window.main.visible(true)
// Movment parameters
anim.main.sensibility(30)
anim.main.friction(18)
anim.main.speed(50)
event.end
event.keyboard:down
var.inc(ptr, 1, var.array.count(WSound), 0)
sound.play(path.rsc(&WSound[&ptr]".wav"))
&Key = keyboard.main.code()
if(&Key = 38)
anim.main.direction(96)
if.end
if(&Key = 40)
anim.main.direction(276)
if.end
if(&Key = 37)
anim.main.direction(186)
if.end
if(&Key = 39)
anim.main.direction(6)
if.end
if(anim.main.speed() < 50)
anim.main.speed(anim.main.speed() + 10)
if.end
event.end
|