Two things I want to ask about but don't think it'd justify two separate threads.
1/ Can someone explain how to do a particle explosion thing that emits in a circular pattern?
I've experimented with particles for dust etc. but thought it might be nice to have a pickup emit a circular particle system when picked up. I don't know how to work with the x and y for each particle.
2/ Can someone point me to a tutorial or code, or whatever for those old school passcode systems for level/life/score saves. I wanted to have a system in their as a homage to games gone by that one would type in a 5 digit passcode and it would carry on the game where you left off. Like Bubble Bobble used to have.
Thanks for your time.
1: I learned to put things on a circle with https://demoman.net/?a=trig-for-games and https://www.lexaloffle.com/bbs/?tid=29094
2: The basic idea for passcodes is to convert some info to numbers, then encode the numbers into a passcode with a custom alphabet. I don’t have a link for that exactly (but search the bbs!), but this is a write-up about encoding level data to passcodes that provides info on the techniques needed: https://tobiasvl.itch.io/picolarium/devlog/41522/picolarium-10-level-editor-and-hints
I dug through the info you linked too and sadly the solution still alludes me. I'm useless at trig.
I've been searching online and the only thing I could find was the name of the thing I'm trying to do... A circle burst.
All the solutions that I can find are for After Effects :(
I thought it would be quite easy, but nope.
Ok but what are you starting from?
With pico8, we get nothing for free, so we have to learn and code everything. If you have a dust particle effect, you have learned about tables, random generation to create x,y coordinates, random changes in coordinates maybe, and a lifetime to make the particles disappear. To change that to a circle effect, then you need to follow the trig tuto (I knew nothing about it before I tried it), then use the functions learned to put the x,y coordinates in a circle around an origin point.
I learned all the stuff you mentioned there.
The dust effect uses just -y to move up slightly with random height. It moves outwards with random x directions.
I just don't know what to put into the random x, random y.
I mean, I could code one particle with x+1. Then another particle with x+1, y+1. Then another with x+1, y+1.5 for example, making them move diagonally....
But then just feels wrong.
@Peej, passcode systems were a real interest of mine years ago. There was a time when I wanted to hack WILLOW for the NES which used a complex password system.
Here, let's create a simple one. 4-letters followed by a dash followed by 4-letters.
Okay now the letters you are using there are only 16-of them so that is 4-bits of data (0-15) could be represented as these selectable characters:
A B D E G I J L N O P R T U V X
Alright so each letter is actually 4-bits of data or 2-characters counts as a single byte.
Since you have 8-characters total that is 32-total bits of data or 4-bytes of data.
Let's say you need 24-bits of data for your game. Well then you can use the first-character and the last-character as a CHECKSUM for the total data.
Basically go from the 2nd character to the 7th adding them up (or multiplying them for greater complexity) being sure to wrap at 256 and then store the results, the top 4-bits in the 1st character position and the lower 4-bits in the 8th character position.
If you add you only have 90 possible checksums.
If you multiply you have 11390625 possible checksums, remembering however that this is broken down to a single byte, that yields 256 possible checksums, still better than just 90.
Then you check to see if the data (chars 2-7) do not match the checksum, then it is an unacceptable password.
To make it more complex you could even shuffle the internal letter storage thus:
E L D V X I B J N R G T A O U P
Be aware though that if you are just trying to save data like the position of a player in a game the 2nd time you run the game from the beginning, Pico-8 is already capable of loading and saving 64-numbers internally or 256-recallable and writable bytes of data to your cart. Check your Pico-8 documentation to see how this is done.
[Please log in to post a comment]