New games every week!
Snow on Switch Blog
18th December 2021
Started a Snow-Game project on Switch.

-=-=-

Honestly, no idea what the aim of the game's going to be, but for those interested, here's how I do my lazily made snow effect.

Step One : Draw snow.
As big of a tile as you can, with a single little snowflake offset in the corner.

Step Two : Starfield
Draw a bog standard starfield, with rotating stars, but instead of stars, draw your snowflake image.



In GotoJSE, we can just use the Starfield function to draw it.
Symbol 0,"2__0_0_0_0_0_0_0_0_0_0_00;;0_0_0_0.;"; Graphics 512,512,1 Repeat CLS Starfield 0,1 Flip Forever


If you have to code the starfield yourself, it's still incredibly easy, though a fair bit lengthier.

Symbol 0,"2__0_0_0_0_0_0_0_0_0_0_00;;0_0_0_0.;"; #CONST $STARS=100 #CONST $X=1 #CONST $Y=2 #CONST $ROTATION=3 #CONST $SPIN=4 Dim star($STARS,4) // Initialisation for m=0 to $STARS Star(m,$X)=Rnd(0,ScreenWidth()) Star(m,$Y)=Rnd(0-32,ScreenHeight()+32) Star(m,$ROTATION)=Rnd(0,360) Star(m,$SPIN)=Rnd(0-2,2) next Graphics 512,512,2 Repeat CLS For m=0 to $STARS // Move each "star" by a random amount, to give a fluttering effect Star(m,$X)=Star(m,$X)+Rnd(-1,1) Star(m,$Y)=Star(m,$Y)+Rnd(-0.5,1.5) // Spin the "star" around. Star(m,$ROTATION)=Star(m,$ROTATION)+Star(m,$SPIN) // Draw "star" SetRotation(Star(m,$ROTATION)) DrawImage Star(m,$X),Star(m,$Y),0 // And if it reaches the bottom of the screen, bump it back up. if Star(m,$Y)>ScreenHeight()+32 then Star(m,$Y)=-32:Star(m,$X)=Rnd(0,ScreenWidth()) Next Flip Forever


Snow easy!
Now I just have to make a game to go with the snow.
Not 100% sure what that game will be, but I've drawn a white cat, and .. um.. That's as far as I got!
Guess we'll have to wait and see what game turns up.
Views 70, Upvotes 5  
Daily Blog , Code
New games every week!
Site credits : Jayenkai put all his heart and soul into everything you can see on this site.
(c) Jayenkai 2023 and onwards, RSS feed 92

Blog - Snow on Switch - AGameAWeek