

Installing and running the gameįor the client, everything is included in the code ( phaser.js,. The code used for the custom binary protocol for the exchange of update packets can be found in js/client/Decoder.js, js/server/Encoder.js and js/CODec.js. Client-side, these updates are processed by Game.updateWorld() and Game.updateSelf(). Every 200ms, GameServer.updatePlayers() is called, and sends updates to all clients (if there are updates to send, as determined by the custom interest management system). Most of the server-side game logic however is located in js/server/GameServer.js. Server.js is the Node.js server that supports the game. The main update loop of the client is Game.update(). Upon reception of this data, Game.initWorld() is called, which finishes starting the game. At the end of Game.create(), a call is made to Client.requestData() (from js/client/client.js) to request initializationĭata from the server. When all assets are loaded, Phaser calls Game.create() where the basics of the gameĪre set up.


Game.preload() is then called, to load theĪssets that haven't been loaded in the Home state. Game.init() is automatically called first by Phaser, to initialize a few variables. Js/client/game.js contains the Game object, which corresponds to the Game state and contains the bulk of the client code. The Game state is started upon calling startGame() from the Home state. The Home state is started first, and will display the home page The game canvas and the game states are created in js/client/main.js. 🔥 If you are interested in this project, you may also be interested in Westward, an open source Javascript MMORPG that I am working on! 🚀 Quick tour of the code Client Socket.io and Node.js for the server and client-server communication.Phaser Quest is a reproduction of Mozilla's Browserquest using the following tools:
