Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============================================================================
- // Jump
- // By Kvothe
- // Jump.js
- // Version: 1.0
- // Free for commercial and non commercial use.
- //=============================================================================
- var Imported = Imported || {};
- //=============================================================================
- // Variáveis.
- //=============================================================================
- const KeyJumpFunction = 'shift'; // Shift Key.
- var _aliasOldUpdateGamePlayer = Game_Player.prototype.update; // Método alias.
- //=============================================================================
- // Game_Player:update
- //=============================================================================
- Game_Player.prototype.update = function() {
- _aliasOldUpdateGamePlayer.call(this); // Velho método.
- // Condição de tecla, teclada.
- if ( Input.isTriggered(KeyJumpFunction) ) {
- this.jump_by_input.call;
- }
- }
- //=============================================================================
- // Game_Player:jump_by_input
- //=============================================================================
- Game_Player.prototype.jump_by_input = function() {
- // Verificar se é possível.
- if ( Game_Player.prototype.isPassable.call(this.x, this.y, this.direction) ) {
- switch (this.direction) { // Checar as direções.
- case 2:
- this.jump(0, 1);
- break;
- case 4:
- this.jump(-1, 0);
- break;
- case 6:
- this.jump(1, 0);
- break;
- case 8:
- this.jump(0, -1);
- break;
- default:
- break;
- }
- }
- }
- //=============================================================================
- // PluginManager:register
- //=============================================================================
- PluginManager.register("Jump", "1.0.0.0", "Adiciona a possibilidade do jogador saltar.", {
- email: "dax-soft@live.com",
- name: "Kvothe",
- website: "www.dax-soft.weebly.com"
- }, "15-10-2015")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement