You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I decided not to add 'shake' API func and added XY variables to the RAM by address 0x3FF9
-- 'shake screen demo' demoshake=0d=4functionTIC()
ifbtnp()~=0thenshake=30endifshake>0thenpoke(0x3FF9,math.random(-d,d))
poke(0x3FF9+1,math.random(-d,d))
shake=shake-1ifshake==0thenmemset(0x3FF9,0,2) endendcls(12)
print("PRESS ANY KEY TO SHAKE THE SCREEN!",24,64)
end
I know this is really old, but in case anyone wants to do this in javascript, its Math.random works a little bit differently. To get a random number between min and max (what lua's random does), you could do something like
add a function to draw entire screen buffer with XY offset
shake [x y]
the offset will reset every frame to 0:0 if you won't call the shake api
The text was updated successfully, but these errors were encountered: