Holiday e-Card
Root / Submissions / [.]
glennxsergeCreated:
Download:LA5YV3Z4Version:Size:
Just a little snow simulator, with some festive music to get my fellow SmileBASIC users in the holiday spirit.
Cute
Thanks, PixelStudio :)
Hi slackerSnail, I started by pre-allocating 2000 particles (just 32bit ints). Using RGB to pack in x,y, radius, and y velocity into R, G, B, and A respectively (ezman showed me this method). Since each component is 8 bit, it meant the maximum value for particle's X position couldn't exceed 255, and since the screen is 400 pixels wide, I had to store half, and then double it when plotting the snowflake to the screen. The collision is very simple, just uses GSPOIT to get the pixel directly below it. If it is empty , the particle keeps falling, otherwise it dies, and if it's a bigger snowflake, it spawns two small ones to the sides of it that keep falling. This helps offset the gaps that tend to naturally form, and gives the appearance of snow drifts, settling. The side to side motion is just a sin function, same with the ground snow layer. That's really about it. I had to copy the sprites I used from the sprite page into the graphics screen page so that GSPOIT could see them. It was a fun little problem.
.. and of course, happy holiday's everyone ;)