Log In  

Cart #driftsnow-1 | 2023-02-26 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

(v01 02-26-23)
TO LOAD THIS PICO-8 CART, in immediate mode, type: load #driftsnow


While some years back I did write a fairly complex cart to draw snowflakes on the screen, they were not incremental. That is they stayed the same number on the screen at all times.

I was noticing in the BSNES emulator they do this instead. They add one snowflake per second on the screen-saver. The effect I think is rather pretty - so here is my version of it for Pico-8.

The code is documented quite thoroughly.

Be aware of some numbers you can fiddle with that are defined at the top of the code:

LONG=30 this determines how many frames pass by before a new snowflake is added. Since the default is 30 it means one new snowflake will appear every second. Or after 33-minutes, there will be over 2,000 snowflakes moving on the screen. Try LONG=15 to see 2-snowflakes added every second.

COLR={5,6,7} this tells what colors the snowflakes will draw for that instance. As it is 3-different colors here, when a snowflake is plotted it will choose one of those numbers at random to give a nice flicker to the snowflake. Try COLOR={7} to have the snowflakes drawn using only the color white.

SPED=1 this is the maximum speed the snowflakes can go. By defaulting to 1 they move a nice comfortable speed. Change this to SPED=2 for instance to have them move twice as fast.

COUN=0 this forces snowflakes to appear. For instance if you wanted to start the cart and have 100 snowflakes appear all at once without waiting for the timer, change this value to 100 with COUN=100

During execution, press any key to see the number of snowflakes and the amount of CPU being used.

And that's it !

If you liked what I did here or have any questions or comments about it, please let me know.


P#126328 2023-02-26 21:31

This looks super realistic! Thank you for sharing and for the extended comments. Gold star

P#126361 2023-02-27 14:36

Well thank you, @vteromero ! I'm glad you like it.

Those comments are not just to help other people but me as well. I guess I'm getting older and it's more difficult for me to concentrate on some things. Remembering what the code does.

I sure hope @zep in the future starts to count comments -- as 100% free and does not take away from your precious 8192-symbols or 65535-chars maximum.

Then everyone might be inclined to comment their code.

P#126374 2023-02-27 18:25

Hey dw817, this is super cool!

Could look awesome as an addition to a title screen or the like... :)

P#126443 2023-02-28 22:44

Could be. Could be @Archonic.

I know Celeste has their own star (snow ?) pattern. The difference is this one literally adds one snowflake per second. So - if it was the background to a title screen, you may be prompted to watch the title screen for minutes - and giving less interest to the game.

I think for now it's pretty good as a screen-saver. Press ALT-ENTER if running offline or click the double-box just below the speaker icon when the cart is running.

Thanks for your interest. I'm glad you like it !

P#126457 2023-03-01 06:15

I can't find your post, @toastgoat.
Did I miss it ?

P#126759 2023-03-08 02:12

[Please log in to post a comment]