Settings

Theme

Show HN: SNES Style Canvas Effects

briandgls.github.io

18 points by __BrianDGLS__ 9 years ago · 4 comments

Reader

zenobit256 9 years ago

How exactly are these "SNES Style"?

Just looks like particle effects. I was hoping to see effects that were actually specific to the SNES.

bitwize 9 years ago

The first DirectX program I ever wrote was called Santa Robotnik.

I drew a sprite of Dr. Robotnik (from Sonic) in his egg-shaped vehicle, which had been fitted with sleigh runners and a sinister-looking robot reindeer. I made it move across the screen with a snow effect in the foreground much like the one see here.

It's real simple to do: just add Brownian motion (a tiny random positive or negative x displacement and a tiny random positive or negative y displacement) to a velocity vector that points down and slightly to the side, and increment the snowflake's position by that per frame. Multiply that by a hundred snowflakes or so, each of which reset, or die and respawn, once they fall off the bottom and you're set.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection