JS13K Games 2019 Day 24

Between work and everything I have to do after work, I've had no time to really sit down and work on Shield Bearer.  It might be a game that I might never finish for this competition.  However, even if I don't finish it in time for the competition, I'll try to finish it some day.

I did have time to check in on my friend and coworker's entry for the JS13K Games Competition.  He's got a red square that will be a porcupine later, and the goal is to collect food (the white dots) while avoiding enemies (the blue square).  It's a pretty good start.  I did find an issue where the porcupine could walk off the screen moving left or right, and it would clip through the floor on landing from a jump.  I saw where I could add some code to fix that, so I did.  Hey, this is a friendly competition!  After looking up how to collaborate on GitHub, I managed to set it up so that I can push commits to my copy of his repo (called a Fork) and make pull requests so that he can copy those to his repo.

Now, I didn't waste the whole day away without touching my code for Shield Bearer!  While I was looking at his code to fix that clipping issue, I found out how he got the HTML5 Canvas to be so big without any scrollbars: through CSS.  What he did was use the * selector to make all the elements of a website have the margin of 0px and overflows set to hidden, then he made height of the html and body elements be 100%.  This caused the canvas to only be the size that can fit on the screen. The solution also works in both Chrome and Firefox; which, was just what I needed!  Just check out the "Fixed Canvas Size" commit in my Shield Bearer repo!

Comments

Popular posts from this blog

JS13K 2020 Game Jam Day 23

Are you coding, son?

Metroidvania Month 7 Day 3