chessmasterhong/WaterEmblem — pull request #45 by DrkSephy (2014-04-14 22:29:29+00:00)
Title: Added more functionality to shop system

This pull request completes the shop system (as far as I can tell for now). The updates are listed below:

* Created and added a sell button.
* Added monetary properties and checks for ensuring player can afford an item.
* Player gains money by selling the item. In the future, we'll tweak the cost based on the remaining durability, so that the player doesn't get the same price back for selling a used weapon.
* Added checks for respawning the menus properly, allowing the player to transition between buying and selling seamlessly.

**Future Work**
I assume that in the future once we hook up director, we'll be using the `index_of_level` within the array to denote which shop list we spawn, which should be a simple hookup. Instead of:

`for(var i = 0; i < this.itemCatalog.shop1.length; i++)`

For spawning the shop items, I assume we'd have:

` for(var i = 0; i < this.itemCatalog.shop[index_of_level].length; i++)`

Where [index_of_level] evaluates to which level we are currently on.

The next thing I'll be working on is adding type-writer text for shops. If that goes well, I'll transition into trying to create a dialog framework.