No description
Find a file
2013-09-03 09:31:53 -07:00
css add zzz light version and classes 2013-08-30 10:19:13 +02:00
dist change some paths, js file size reduced by around 400kb 2013-09-03 17:08:22 +02:00
img Merge branch 'rewrite' of github.com:HabitRPG/habitrpg-shared into rewrite 2013-09-02 21:39:57 -04:00
script don't run drops on the client. they will be wiped on refresh anyway, 2013-09-02 20:51:21 -04:00
tests cron: add timezone calculation into the midst. Note: this requires user.preferences.timezoneOffset exist on the user, otherwise it will default to the script-runner timezone (which works fine if user or browser) 2013-08-20 21:40:39 -04:00
.gitignore ignore .js & .map from (webstorm transpilers), remove habitrpg-shared 2013-08-20 21:27:56 -04:00
favicon.ico add a bunch of possible shared items for now, will clean up later 2013-03-11 14:50:00 -04:00
Gruntfile.js comment 2013-09-03 17:16:47 +02:00
package.json change some paths, js file size reduced by around 400kb 2013-09-03 17:08:22 +02:00
README.md update readme 2013-08-26 22:33:56 -04:00

Shared resources useful for the multiple HabitRPG repositories, that way all the repositories remain in-sync with common characteristics. Includes things like:

  • Assets - sprites, images, etc
  • CSS - especially, esp. sprite-sheet mapping
  • Algorithms - level up algorithm, scoring functions, etc
  • View helper functions that may come in handy for multiple client MVCs
  • Item definitions - weapons, armor, pets

##Installation

  • npm install

  • grunt - after you've made modifications and want to compile the dist files for browser

  • Node.js

    • require ('coffee-script')
    • require('./script/algos.coffee'), require('./script/helpers.coffee'), etc.
  • Browser

    • 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
  • Note how to invoke scoring function:

    • algos.score(user, task, direction), etc
    • TODO document all the functions

##CSS 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.

Currently, all or most spritesheets are available. They're in css/*.css, but that's not what you want. You want /spritesheets.css which is the concat'd file (using grunt) which includes all the spritesheets. I'd prefer this be in /dist/spritesheets.css for consistency, but it's having image referencing weirdness