Controls:
- right/left to increase/decrease amplitude
- up/down to increase/decrease wavelength
- Z/X to increase/decrease animation speed
- Q to change background
- W to change effect type
I've been toying around with my Pico-8 for the last few days and after a good amount of bashing my head against a wall I finally have something cool and somewhat presentable. It translates horizontal lines on the screen either horizontally or vertically in a sine-wave-like pattern, just like the battle backgrounds in Earthbound and Mother 3.
Thinking of making a short vertical slice of some sort of RPG with a basic battle system that makes use of it.
Here are the relevant code snippets if you'd like to use the effects in your own game:
Some things worth noting:
- y1 and y2 values lower than 0 and higher than 127 will likely corrupt data in the RAM and/or crash the game
- if the wavelength is set to 0 a division by zero happens, but it seems like Pico-8 handles division by zero implicitly
- you could technically get around the "max height 112" problem with sine_yshift if you copy the screen data to 0x3f00 instead of 0x4300, which will overwrite part of the sound region of the RAM but give you another 16 horizontal lines to work with
Not sure what else to say... If you have any questions or comments I'll happily answer them!
Old version:
I love it! I'm impressed by how many effects you can get by fiddling with these settings.
Wow this is VERY nice! Thank you very much for the code snippets!!
Discovered a slight bug with sine_yshift and fixed it - the very last line would grab incorrect values. Updated the code snippets with the corrected code (dy = y2-y1+1).
Also fixed the positioning of the text at the bottom.
Niiice, makes me think of my C version for a calculator! Now you need to implement plaette cycling! :D
This doesn't actually worked no matter how many things I clicked or pressed
Yep, crashes immediately now before any keys are hit or anything.
It's because it redefined the 'type' global, which is usually a built-in function that returns the type of the argument that's passed in. Looks like @zep is now using that in tostr(), which is used inside print(), so it broke here.
I don't know if @qbicfeet is still active, so for now, here's a fixed version with a different name for the naughty global variable.
[Please log in to post a comment]