123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- shake=0
- wobbleDirection = 0
- shakeAmount = 0
- function wobbleScreen()
- shakeAmount=math.max(0,(shakeAmount-0.5))
- if shakeAmount>0 then
- t=time()/20
- offsetX=shakeAmount*math.cos(wobbleDirection)*math.sin(t)
- offsetY=shakeAmount*math.sin(wobbleDirection)*math.sin(t)
- poke(0x3ff9, offsetX)
- poke(0x3ffa, offsetY)
- end
- end
- function TIC()
- cls()
- map()
- print("Press B to shake!", 60, 100)
- if btnp(5) then
- shakeAmount=shakeAmount+10
- wobbleDirection=math.random()*2*math.pi
- end
- shakeScreen()
- end
|