Nodejs backed wack a mole Game

--- due date not met yet
I'll share my idea of the classic
game wack a mole for js13k so space is crucial.
I'm using my micro game engine node-craters.js for nodejs
my first plan is
split the engine take out the loop and update leave the task to the server , using socket.io for communicating information back and forth
when the user opens the game index.html socket.io is loaded later the game.js file containing rendering and canvas. rendering basically nothing much and initial loading text is displayed below there's some functions for socket communication ,
once the page is loaded the game emits a start command telling the server am ready let's play with an optional argument room id vital for playing a game with a friend.

the server gets the start command and additionally checks if there's a room id so that the user or player joins an existing match or else  create a new room and emit the users details to tell them their id and room id ,
if there enough people in the room blow the whistle emit 'gameon'

when the client gets the initialization event that information is saved somewhere for future reference just in case .

when the client gets the gameon event it clears the loading screen and deploys our hero the mole and what determines the location of the mole comes through an event from the server every a few seconds or so

Comments