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

Project1

 找回密码
 注册会员
搜索
查看: 2647|回复: 3
打印 上一主题 下一主题

[原创发布] 通用(狂野)游戏加速代码

[复制链接]

Lv3.寻梦者

梦石
0
星屑
3461
在线时间
292 小时
注册时间
2020-1-27
帖子
190
跳转到指定楼层
1
发表于 2020-2-29 11:59:17 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 zths 于 2020-2-29 13:06 编辑

对付没有加速跳过的游戏的神器。(针对玩家)
对所有状态生效:包括但不限于 行走 战斗 对话
原理是加倍调用Scene 和 Window 的 update方法。。
理论上对各种插件的游戏均能有效兼容。。

使用方法是 下面代码丢到index.html里。
然后在游戏里按下ctrl即可加速

配置:

由于每秒调用10次 可能会对性能有影响?(应该不会)

HTML 代码复制
  1. <script>
  2. keys = {};
  3. function isKeyPressed(kc){
  4.         if(typeof(kc) == "undefined"){
  5.                 return false
  6.         }
  7.         return keys[kc] === true
  8. }
  9. if(typeof(handleWkd) == "undefined"){
  10.     handleWkd = true
  11.     jQuery(window).on("keydown",function(ev) {
  12.         keys[ev.keyCode] = true;
  13.     });
  14.     jQuery(window).on("keyup",function(ev) {
  15.         keys[ev.keyCode] = false;
  16.     });
  17. }
  18. AlwaysMulti = false
  19. pauseSence = false
  20. updateMainMultiply_Multiply = 1
  21. updateMainMultiply_MultiplyActiveKey  = 17
  22. function SceneHook(){
  23.     if(typeof updateMainMultiply_Multiply === "undefined"){updateMainMultiply_Multiply = 1;}
  24.     if(typeof AlwaysMulti === "undefined"){AlwaysMulti = false;}
  25.     if(typeof pauseSence === "undefined"){pauseSence = false;}
  26.     if(typeof SceneManager === "undefined"){return;}
  27.     if(typeof SceneManager._scene === "undefined"){return;}
  28.         if(typeof SceneManager._scene.update === "undefined"){return;}
  29.     if(typeof SceneManager._scene.updateBk === "undefined"){
  30.         SceneManager._scene.updateBk = SceneManager._scene.update
  31.     }
  32.     SceneManager._scene.update = function(){
  33.                 if(pauseSence){return;}
  34.         if(isKeyPressed(updateMainMultiply_MultiplyActiveKey) || AlwaysMulti){
  35.             for(var i=0;i<updateMainMultiply_Multiply;i++){
  36.                 this.updateBk.apply(this,arguments);
  37.             }
  38.         }
  39.         return this.updateBk.apply(this,arguments);
  40.     }
  41.         if(typeof SceneManager._scene._windowLayer === "undefined"){return;}
  42.         if(typeof SceneManager._scene._windowLayer.children === "undefined"){return;}
  43.         if(typeof SceneManager._scene._windowLayer.children.length === "undefined"){return;}
  44.     for(var i=0;i<SceneManager._scene._windowLayer.children.length;i++){
  45.         if(
  46.             SceneManager._scene._windowLayer.children[i]
  47.             && typeof SceneManager._scene._windowLayer.children[i].update !== "undefined"
  48.             && typeof SceneManager._scene._windowLayer.children[i].updateBk === "undefined"
  49.         ){
  50.             SceneManager._scene._windowLayer.children[i].updateBk = SceneManager._scene._windowLayer.children[i].update
  51.         }
  52.         SceneManager._scene._windowLayer.children[i].update = function(){
  53.                         if(pauseSence){return;}
  54.             if(isKeyPressed(updateMainMultiply_MultiplyActiveKey) || AlwaysMulti){
  55.                 for(var i=0;i<updateMainMultiply_Multiply;i++){
  56.                     this.updateBk.apply(this,arguments);
  57.                 }
  58.             }
  59.             return this.updateBk.apply(this,arguments);
  60.         }
  61.     }
  62. }
  63. if(typeof SceneHookInv !== "undefined"){
  64.     clearInterval(SceneHookInv);
  65. }
  66. SceneHookInv = setInterval(SceneHook,100);</script>

Lv4.逐梦者

梦石
0
星屑
19430
在线时间
1033 小时
注册时间
2019-3-5
帖子
1419
2
发表于 2020-3-3 18:28:48 | 只看该作者
约等于变数齿轮?
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
14327
在线时间
718 小时
注册时间
2011-7-16
帖子
1428

开拓者

3
发表于 2020-3-3 18:51:31 | 只看该作者
牛,好东西呀,会不会手机发烫?
RMMV网络插件,开源免费,内含服务器端,无需强制登录,云数据,弹幕,云存档,排名,兑换码,版本检测,可自由上架下架删除。q群399090587
免打包运行MV游戏,云游戏,安卓App雷神游戏厅,在线玩游戏,上传下载游戏
开源游戏:重装机兵之重装归来【RMMV制作】全球首款按照美剧分季分集的方式发布的游戏
体素画 -- MV画3D像素图的画板
RMMV显示3D模型和场景的插件
RMMV显示spine骨骼动画的插件
RMMV秘密通道插件
突破敌群数量上限8个的插件
在rmmv中显示gif动态图片的插件
一款可以在mv游戏界面的任意位置显示任意文字的插件
RMMV Toast 插件 带物品得失提示,可以设置开启关闭 兼容yep itemcore
制作一个改名卡道具插件、调整标题页面菜单的插件、在标题页面之前显示大段文字的插件、标题页面显示版本号的插件
物品得失自动提示自动上色自动换行插件
我的Q群 663889472
另外,我的插件、范例、游戏都在这里
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

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

GMT+8, 2024-6-17 07:31

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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