Advertisement
aandnota

player.js

Feb 28th, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ig.module(
  2.     'game.entities.player'
  3. )
  4. .requires(
  5.     'impact.entity'
  6. )
  7. .defines(function(){
  8.     EntityPlayer = ig.Entity.extend({
  9.         animSheet: new ig.AnimationSheet('media/player.png', 16, 16),
  10.         size: {x: 8, y: 14},
  11.         offset: {x: 4, y: 2},
  12.         flip: false,
  13.        
  14.         maxVel: {x: 100, y: 150},
  15.         friction: {x: 600, y: 0},
  16.         accelGround: 400,
  17.         accelAir: 200,
  18.         jump: 200,
  19.        
  20.         init: function( x,y, settings){
  21.             this.parent( x,y, settings);
  22.             //add animations
  23.             this.addAnim('idle', 1, [0]);
  24.             this.addAnim('run', 0.07, [0,1,2,3,4,5]);
  25.             this.addAnim('jump', 1, [9]);
  26.             this.addAnim('fall', 0.4, [6,7]);
  27.            
  28.             //this.currentAnim = this.anims.idle;
  29.         }
  30.     });
  31. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement