2013-08-27 01:54:08 +00:00
Shared resources useful for the multiple HabitRPG repositories, that way all the repositories remain in-sync with common characteristics. Includes things like:
2013-03-12 21:46:36 +00:00
* Assets - sprites, images, etc
* CSS - especially, esp. sprite-sheet mapping
* Algorithms - level up algorithm, scoring functions, etc
2013-05-15 14:08:35 +00:00
* Item definitions - weapons, armor, pets
2013-03-12 21:41:32 +00:00
2013-03-12 21:46:36 +00:00
##Installation
2013-08-27 01:54:08 +00:00
* `npm install`
* `grunt` - after you're done and you want to create the dist files
2013-05-17 02:30:19 +00:00
* Node.js
2013-05-24 05:29:04 +00:00
* `require ('coffee-script')`
* `var shared = require('./index.js')` or `require('./script/algos.coffee')` if you only need one file.
* Browser
2013-08-27 01:54:08 +00:00
* Use `<script/>` tag to include ./dist/habitrpg-shared.js it will export `window.habitrpgShared` object.
* // Use `browser.debug.js' if you want to have sourcemaps. - EDIT: Only one file now, and it has sourcemaps. Fix this
2013-05-24 05:29:04 +00:00
2013-05-15 14:08:35 +00:00
* Note how to invoke scoring function:
2013-08-27 01:54:08 +00:00
* algos.score = function (user, task, direction) {}
2013-04-10 19:00:40 +00:00
##CSS
2013-08-27 01:54:08 +00:00
Shared CSS between the website and the mobile app is a fuzzy area. Spritesheets definitely go in habitrpg-shared (since mobile
uses them too). Other things, like customizer buttons, *may* want to go here? As you find sharable components, (1) move them
from the website into habitrpg-shared, (2) remove from website & make sure all html/css references are updated.