Log In  

5

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

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.

tech demo distortion screen effect


P#38027 2017-03-04 00:39

Log in to post a comment

user:
password:

New User | Account Help
:: New User
X
About | Contact | Updates | Terms of Use
Follow Lexaloffle:
Generated 2017-03-24 17:55 | 0.099s | 1572k