Advertisement
XArnonX

sprite-constants

Feb 16th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var SpriteConstants = (function () {
  2.  
  3.   'use strict';
  4.  
  5.  
  6.   // public api
  7.   var _constants = {};
  8.  
  9.   // constants
  10.   _constants.SIZE = 100;
  11.   _constants.Animation = getAnims();
  12.   _constants.Anchor = getAnchor();
  13.   _constants.Direction = getDirections();
  14.  
  15.   return _constants;
  16.  
  17.  
  18.   function getAnims() {
  19.     return {
  20.       STILL_UP: 'still-up',
  21.       STILL_DOWN: 'still-down',
  22.       STILL_SIDE: 'still-side',
  23.       WALKING_UP: 'walking-up',
  24.       WALKING_DOWN: 'walking-down',
  25.       WALKING_SIDE: 'walking-side'
  26.     };
  27.   }
  28.  
  29.   function getAnchor() {
  30.     return {
  31.       X: 0.5,
  32.       Y: 1
  33.     };
  34.   }
  35.  
  36.   function getDirections() {
  37.     return {
  38.       UP: 'up',
  39.       RIGHT: 'right',
  40.       DOWN: 'down',
  41.       LEFT: 'left'
  42.     };
  43.   }
  44.  
  45. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement