Log In  


Cart #38026 | 2017-03-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
7

Press [Z] to start distortion, [X] to increase distortion amount.

A simple screen distortion effect using memcpy, using only 63 tokens.

Easy install, just copy the line below:

function distort(a)a=min(a,64)for y=0,127 do local r=flr(-a+rnd(a*2)+0.5)local s,e,l,m=max(-r,0),max(r,0),64-abs(r),24576+y*64memcpy(m+e,m+s,l)end end

And paste it in your project. Then add

distort(amount)

(replace amount with desired distortion amount) to the bottom of your _draw loop in an if condition to prevent it from being always on. For best effect, use a timer to turn it on and off.

Open the cartridge in editor for more details.

7



[Please log in to post a comment]