Advertisement
DaxSoft

Jump Player

Oct 15th, 2015
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // Jump
  3. // By Reshi
  4. // Jump.js
  5. // Version: 1.0
  6. // Free for commercial and non commercial use.
  7. //=============================================================================
  8. var Imported = Imported || {};
  9.  
  10. var _aliasOldUpdateGamePlayer = Game_Player.prototype.update;
  11. Game_Player.prototype.update = function() {
  12.   _aliasOldUpdateGamePlayer.call(this);
  13.  
  14.   if (  Input.prototype.trigger.call(:X)  ) {
  15.  
  16.     if ( Game_Player.prototype.passable.call(this.x, this.y, this.direction) ) {
  17.       switch (this.direction) {
  18.         case 2:
  19.           this.jump(0, 1);
  20.           break;
  21.         case 4:
  22.           this.jump(-1, 0);
  23.           break;
  24.         case 6:
  25.           this.jump(1, 0);
  26.           break;
  27.         case 8:
  28.           this.jump(0, -1);
  29.           break;
  30.         default:
  31.           break;
  32.       }
  33.     }
  34.  
  35.   }
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement