Based on the 1976 arcade hit, Blockade: Our intrepid jr dev seeks to squash bugs and leave their code looking dry and easily understood. (Its a snake game)
- HTML/CSS
- JS
Press Start 2P Modern Interiors Sprites SoundsByDane - 8Bit Sound Pack Whaaa - jefftheworld
Using the arrow keys or swipe on touch devices, navigate the junior dev and try to squash as many bugs as possible before you accidentally cause a stack overflow (trip over your own stack) play
- socket.io full stack edition for live multiplayer
- true i18n support
- add some enemies to make the game harder
- improve overall aesthetic thru consistent sprites and such
on page load, define environemnt classes:
-
gameboard: flexible world size, contains array containging all positions
-
snake: contains array subset of gameboard which is the snake, functions for updating position, direction and checking collision
-
bugs: array subset of bugs, arrays for creating and destroying bugs
variables: player score, lives, time count
eventlisteners:
- click: start game
- keydown: determine player direction
wait for player input to start game, begin main loop render loop:
- increment real-time time counter
- update player direction
- update player position
- check for collisions
- if collision with bug, create a new bug and increase snake length
- if collision with self, subtract one life and reset snake position while maintaining length/score
- if it was players last life, end game and bring back to title screen
- if player is at edge, loop to other side
- dom manipulation - draw board