A brand new game
for Windows, HTML5, 3DS Homebrew, iPhone, Android TV and more,
every week,
unless exhausted!
About Games Pixelart Music Poetry Home Patreon Mailbag Scores JNKPlat Levels
  2nd December, 2018

I coded a snowglobe, yesterday.


Needing a Xmas avatar, but also wanting to make something to put towards the Advent of Creativity, I took some time to write a Platdude Snowglobe in Blitz3D.

The biggest challenge was trying to keep the snow inside the globe.
I tried collision detection, but that was all kinds of slow.
Blitz3D wasn't quite prepared to analyse the hundreds of flakes.

I also tried working out 3D positional co-ordinates, but my head gave up trying that.

In the end, I opted for a scaled position based on the Y co-ordinate.
Find the height of the snowflake, then use Pythagoras to find the distance the snowflake is from the center, then ensure that's roughly within the approximate scale that the circle should be for that height.

.. It's not exact.
It's a bit rubbish if I'm honest.
But it does the job well enough for the effect.

You can Download the Snowglobe here. (Blitz3D Sourcecode included)
It doesn't do anything, just spins around keeps the snow fluttering away.

Views 30, Upvotes 1
Daily Blog
Site credits : Jayenkai, one crazy fool who has far too much time on his hands.
(c) Jayenkai 2017 and onwards.
Blog - Snowglobe - AGameAWeek