I wrote a separate static class "Input" on the basis of your ) Very comfortably.
-- script: moon
-- static class, not need instantiate it
class Input
UP=0
DOWN=1
LEFT=2
RIGHT=3
GetHorAxis:=> @btnAxis(LEFT,RIGHT)
GetVerAxis:=> @btnAxis(UP,DOWN)
btnAxis:(a,b)=>
if btn(a) and btn(b)
return 0
elseif btn(a)
return -1
elseif btn(b)
return 1
else
return 0
class Spr
new:(id=0,x=0,y=0,alpha=-1,scale=1,flip=0,rotate=0)=>
@id=id
@x=x
@y=y
@alpha=alpha
@scale=scale
@flip=flip
@rotate=rotate
draw:=>
spr(@id,@x,@y,@alpha,@scale,@flip,@rotate)
--------------------
logo=Spr(1,104,24,2,4)
export TIC=->
--update
logo.x+=Input\GetHorAxis()
logo.y+=Input\GetVerAxis()
logo.id=time()%1000//500+1
--draw
cls(12)
logo\draw()
print("HELLO WORLD!",84,64)