-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
RS_GameSpeed.js
94 lines (88 loc) · 2.84 KB
/
RS_GameSpeed.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//================================================================
// RS_GameSpeed.js
// ---------------------------------------------------------------
// The MIT License
// Copyright (c) 2019 biud436
// ---------------------------------------------------------------
// Free for commercial and non commercial use.
//================================================================
/*:
* @target MV
* @plugindesc This plugin allows you to speed up or speed down the game speed. <RS_GameSpeed>
* @author biud436
*
* @param FPS
* @type number
* @desc The default game speed (60 Frame per second)
* @default 60
*
* @help
* When you first start up a game,
* it will apply the game speed as you did set up in the plugin parameter.
*
* =======================================================
* Plugin Commands
* =======================================================
* The plugin commands allows you to change the game speed during the game.
*
* Change the game speed with 30 frame per second.
* ChangeFPS 30
*
* Change the game speed with 60 frame per second.
* ChangeFPS 60
*
* Change the game speed with 120 frame per second.
* ChangeFPS 120
*
* =======================================================
* Version Log
* =======================================================
* 2019.05.06 (v1.0.0) - First Release.
*/
/*:ko
* @target MV
* @plugindesc 게임 속도를 조절합니다 <RS_GameSpeed>
* @author biud436
*
* @param FPS
* @type number
* @desc 초당 프레임 수
* @default 60
*
* @help
* =======================================================
* Plugin Commands
* =======================================================
* 게임 속도를 초당 30 프레임으로 설정합니다.
* ChangeFPS 30
*
* 게임 속도를 초당 60 프레임으로 설정합니다.
* ChangeFPS 60
*
* 게임 속도를 초당 120 프레임으로 설정합니다.
* ChangeFPS 120
* =======================================================
* Version Log
* =======================================================
* 2019.05.06 (v1.0.0) - First Release.
*/
(() => {
const RS = RS || {};
RS.GameSpeed = RS.GameSpeed || {};
let parameters = $plugins.filter(i => {
return i.description.contains('<RS_GameSpeed>');
});
parameters = parameters.length > 0 && parameters[0].parameters;
$.Params = {};
$.Params.FPS = parseFloat(parameters.FPS || 60);
SceneManager._deltaTime = 1.0 / $.Params.FPS;
const alias_Game_Interpreter_pluginCommand =
Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function (command, args) {
alias_Game_Interpreter_pluginCommand.call(this, command, args);
if (command === 'ChangeFPS') {
RS.GameSpeed.Params.FPS = parseFloat(args[0] || 60);
SceneManager._deltaTime = 1.0 / $.Params.FPS;
}
};
})();