Created
January 5, 2017 01:31
-
-
Save morningtoast/18a2f24a0706226e8762116b801303c4 to your computer and use it in GitHub Desktop.
Glitch effect for Pico-8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function glitchfx(lines) | |
| local lines=lines or 64 | |
| for i=1,lines do | |
| row=flr(rnd(128)) | |
| row2=flr(rnd(127)) | |
| if (row2>=row) row2+=1 | |
| // copy a row from the | |
| // screen into temp memory | |
| memcpy(0x4300, 0x6000+64*row, 64) | |
| //copy another row from the | |
| // screen to our original row | |
| memcpy(0x6000+64*row, 0x6000+64*row2, 64) | |
| //copy the temp row into row2's | |
| //original slot | |
| memcpy(0x6000+64*row2, 0x4300,64) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment