jonoxia / rpgbase

Generic Node.js/HTML5 role-playing game client/server
8 stars 6 forks source link

Refactor: make GenericRPG base class that composits all the other classes #59

Closed jonoxia closed 10 years ago

jonoxia commented 11 years ago

To replace the sphagetti-callbacks that are currently scattered all over the place. GenericRPG class can, among other things, have a single canonical variable for what mode the game is in right now (or a simple state machine, perhaps) and use that to prevent multiple mode switches from triggering at the same time.

GenericRPG would also contain all the assumptions like "characters gain exp when a fight ends, and sometimes learn spells on level-up" which are almost always true but which I don't want to code straight into the base classes.