Log In  


Cart [#38026#] | Copy | Code | 2017-03-04 | Link

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


(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.

tech demo distortion screen effect
P#38027 2017-03-04 00:39

Log in to post a comment


New User | Account Help
:: New User
About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2017-09-22 16:54 | 0.193s | 1572k | Q:17