forked from mozilla/BrowserQuest
-
Notifications
You must be signed in to change notification settings - Fork 1
Battle System
jeffplang edited this page Aug 6, 2012
·
4 revisions
First, a rough outline of how battles are initiated:
-
this.makePlayerAttack(entity)called ingame.click(). -
this.createAttackLink(this.player, mob)called inthis.makePlayerAttack(mob). -
attacker.engage(target)called inthis.createAttackLink(attacker, target). - TODO: finish
- Client sends a message
Types.Messages.ATTACKpassingmob.id - The player's Player instance on the server listens on the websocket connection and handles the
Types.Messages.ATTACKmessage on line 117.