Advertisement
Guest User

Untitled

a guest
Feb 19th, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. define("Holoboy", ['Controllable'],
  2.  
  3.   function( Controllable ) {
  4.  
  5.     var Holoboy = function (x, y){
  6.  
  7.       this._speed = 250;
  8.       this._gravity = 350;
  9.       this._jump = 250;
  10.  
  11.       this.sprite = this.game.add.sprite(x, y, 'holoboy');
  12.       this.sprite.anchor.x = 0.5;
  13.       this.sprite.body.gravity.y = this._gravity;
  14.       this.sprite.body.collideWorldBounds = true;
  15.       this.sprite.body.allowGravity = false;
  16.  
  17.       this.sprite.animations.add('idle', [0,2,2,2,0,0,3,4,5,6,7,8,3,4,5,6,7,8,3,4,5,6,7,8,9,9,10,11,12,12,13,13,14,15,15,15,0,0,0,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36], 16, true);
  18.       this.sprite.animations.add('run', [3,4,5,6,7,8], 12, true);
  19.  
  20.     // initialise jump and release events
  21.       this.initOtherEvents();
  22.  
  23.     }
  24.  
  25.     Holoboy.prototype = new Controllable();
  26.  
  27.     return Holoboy;
  28.    
  29.   }
  30.  
  31. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement