设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索

【插件】人物地图缩放

查看数: 7000 | 评论数: 3 | 收藏 13
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2015-11-24 23:03

正文摘要:

本帖最后由 过眼云烟 于 2015-11-24 23:04 编辑 有没有感觉到在大地图上显示大头人物显得很突兀,这个插件旨在帮助您解决这个问题。 使用方法是在地图备注栏添加<Character_zoom:0.5>标签,即地图上人物缩放为0.5 ...

回复

wudicc1 发表于 2021-9-1 22:19:27
6666666666666666666
语义噪音 发表于 2015-11-30 14:46:48
本帖最后由 语义噪音 于 2015-12-1 11:38 编辑

我觉得对于载具的判断,最好还是使用instanceof操作符比较好。检查this._character是否是Game_Vehicle的一个实例,比起用名称来判断,这样做更加优雅。

顺手把降低移动速度和禁止冲刺加上了。另外,我把方法抽离出来形成了一个单独的对象用于调用,增加了调用方法的插件命令。

JAVASCRIPT 代码复制
  1. var PluginMethods;
  2.  
  3. PluginMethods = {
  4.   doScale: function(scale) {
  5.     var _Sprite_Character_prototype_update;
  6.     _Sprite_Character_prototype_update = Sprite_Character.prototype.update;
  7.     Sprite_Character.prototype.update = function() {
  8.       _Sprite_Character_prototype_update.call(this);
  9.       if (!(this._character instanceof Game_Vehicle)) {
  10.         this._character._dashing = false;
  11.         this._character._moveSpeed = scale * 4;
  12.         this.scale.x = scale;
  13.         this.scale.y = scale;
  14.       }
  15.     };
  16.   }
  17. };
  18.  
  19. (function() {
  20.   var _Game_Interpreter_pluginCommand;
  21.   _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  22.   return Game_Interpreter.prototype.pluginCommand = function(command, args) {
  23.     _Game_Interpreter_pluginCommand.call(this, command, args);
  24.     switch (command) {
  25.       case 'plug-in':
  26.         switch (args[0]) {
  27.           case 'doScale':
  28.             PluginMethods.doScale(args[1]);
  29.         }
  30.     }
  31.   };
  32. })();

点评

好吧,你是大神。主要考虑一些特定场景,毕竟地图上不是只有猪角用的一艘船,一搜飞空艇  发表于 2015-11-30 17:59
拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-2 22:58

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表