Skip to content
OmeGak edited this page Aug 21, 2012 · 2 revisions

In this page we'll be posting the investigations we are performing over the least obvious BrowserQuest pieces of code. Feel free to add a section if you had a hard time figuring out anything, you will probably help someone in the future. ;)

Module loader

In order to encourage a modular code, this project uses RequireJS.

Game main initialization (Work in progress)

index.html triggers: (via rquire-jquery) initApp() in main.js.

  1. home.js

initApp():

  • i think this calls init() of most of the main game classes referenced below.

Then the page/game waits till a new player is created or joins.

When a character is created (Work in progress)

client/js/main.js: app.tryStartingGame() client/js/app.js: tryStartingGame() calls startGame() calls start()

  • sets some server options. game.username (ie player-selected username) is set here.
  • calls this.game.run() client/js/game.js: run()
  • calls initPlayer(), which sets the sprite according to this.player.getSpriteName(); the sprite is actually hard coded into the Player class as "clotharmor"; the "kind" is used to

Clone this wiki locally