Advertisement
rito_kun

Rito_BattleGround_Animation

Nov 12th, 2015
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // Rito_BattleGround_Animation.js
  3. //=============================================================================
  4.  
  5. /*:
  6.  * @plugindesc (v1.0) Animation Scrolling Battle Background
  7.  * @author Rito
  8.  *
  9.  *
  10.  * @help  
  11.  * =============================================================================
  12.  * / Animation Scrolling Battle Background \
  13.  * By Rito
  14.  * =============================================================================
  15.  * Plugin command :
  16.  * BATTLEGROUND Background1_x Background1_y Background2_x Background2_y
  17.  * Ex : BATTLEGROUND 1 0 1 0
  18.  *
  19.  * To clear :
  20.  * BATTLEGROUND 0 0 0 0
  21.  *
  22.  * The background is selected in the parameters of the map.
  23.  * Doesn't work if any background is selected in the map parameters.
  24.  */
  25.  
  26. //=============================================================================
  27. // ** PLUGIN PARAMETERS
  28. //=============================================================================
  29. var Imported = Imported || {};
  30. Imported.Rito_BattleGround = true;
  31. var Rito = Rito || {};
  32.  
  33. Rito.parameters = PluginManager.parameters('Rito_BattleGround_Animation');
  34.    
  35. var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  36. Game_Interpreter.prototype.pluginCommand = function(command, args) {
  37.     _Game_Interpreter_pluginCommand.call(this, command, args);
  38.  
  39.     if (command.toUpperCase() === 'BATTLEGROUND') {
  40.       Spriteset_Battle.prototype.BattleGround(args);
  41.     };
  42. };
  43.  
  44. var _alias_rito_background_effects_update = Spriteset_Battle.prototype.updateBattleback;
  45. Spriteset_Battle.prototype.updateBattleback = function() {
  46.     _alias_rito_background_effects_update.call(this);
  47.     this.update_background_effects();
  48. };
  49.  
  50.  
  51. Spriteset_Battle.prototype.update_background_effects = function() {
  52.     this._back1Sprite.origin.x += Rito.battle_bg1_x;
  53.     this._back1Sprite.origin.y += Rito.battle_bg1_y;
  54.     this._back2Sprite.origin.x += Rito.battle_bg2_x;
  55.     this._back2Sprite.origin.y += Rito.battle_bg2_y;
  56.     this._back1Sprite.update;
  57.     this._back2Sprite.update;
  58. };
  59.  
  60. Spriteset_Battle.prototype.BattleGround = function(args) {
  61.     Rito.battle_bg1_x = eval(args[0]);
  62.     Rito.battle_bg1_y = eval(args[1]);
  63.     Rito.battle_bg2_x = eval(args[2]);
  64.     Rito.battle_bg2_y = eval(args[3]);
  65. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement