Log In  

Hello all...
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.

P#97018 2021-09-07 20:19

:: merwok

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

P#97029 2021-09-07 21:31
:: Peej

Thanks for the help @merwok

P#97064 2021-09-08 18:45
:: merwok

Please feel free to post follow-up questions here, or even a partially working cart!

P#97067 2021-09-08 19:31
:: Peej

Thanks, @merwok
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.

P#97073 2021-09-08 20:11
:: merwok

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.

P#97077 2021-09-08 21:20
:: Peej

You're right.
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.

P#97082 2021-09-08 22:17
:: Peej

Actually... I think I'm getting it!!

P#97083 2021-09-08 22:36
:: merwok

You have part of the right idea! You would increase turn from 0 to 1, by increment of 0.1 for example, and create a particle for each. To go from turn to x, y you use the sin and cos functions explained by demo-man!

P#97086 2021-09-09 00:28

It's been a long time since I looked into passcodes, but Metroid on nes has some pretty easy to understand logic behind items gathered and progression gates being passed

P#97229 2021-09-12 14:36
:: Peej

Thanks @VgBlade. It seems passcode systems are more complicated than I imagined.

P#97238 2021-09-12 20:11
:: dw817

@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:


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:


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.

P#97264 2021-09-13 01:53 ( Edited 2021-09-13 02:00)

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2021-09-25 10:14:18 | 0.069s | Q:23