加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 LBQ 于 2015-10-3 10:27 编辑
10月3日:
有了TextManager你说我们要不要i18n
binary json可以试试
10月2日:
没有预想的那么恶心233
class Scene_Crafting extends Scene_MenuBase
initialize: ->
super()
create: ->
super()
this.createBackground()
this.createWindowLayer()
this.createGoldWindow()
start: ->
super()
createGoldWindow: ->
@goldWindow = new Window_Gold(0,0)
this.addWindow(@goldWindow)
class Scene_Crafting extends Scene_MenuBase
initialize: ->
super()
create: ->
super()
this.createBackground()
this.createWindowLayer()
this.createGoldWindow()
start: ->
super()
createGoldWindow: ->
@goldWindow = new Window_Gold(0,0)
this.addWindow(@goldWindow)
我没法用Plugin更改plugin manager
我选择死亡
pixi.js用的v2感觉很不爽,应该移植到v3的
其实重点是pixi.js啊
想想看这些可能性啊
Google closure compiler的advance编译别想了,mv代码没有预先准备最终产物没法运行
UglifyJs之类的还是可以用
Desktop版本会用Nw.js作为Js后端,可以直接开node
binary json估计是可以用
原网页:http://preorder.rpgmakerweb.com/rpg-maker-mv/
毕竟有游戏了所以解析一下吧:
1:Yanfly下手好快,现在就有脚本了是怎么回事,黑幕吗
2:渲染用的Pixi.js,我很开心
继续读代码中,游戏不知道为何玩不了只能读代码了
3:没有用npm或者commonjs之类的,直接采用的html引用脚本,这个到时候得修一下
4:主题代码被minify或者obfuscate了,不好读
5:core.js:https://www.refheap.com/110141
6:managers.js:https://www.refheap.com/110142
很明显数据库用的json
好评
7:objects.js:https://www.refheap.com/110143,太长了,refheap不知道为何不行。
objects.7z
(36.89 KB, 下载次数: 60)
8:scenes.js:https://www.refheap.com/110144
9:sprites.js : https://www.refheap.com/110145
Window.prototype.initialize是什么鬼
看得出来代码是中规中矩的ruby式js....?
本来Js比Ruby更加Functional一些的,但是为了保持惯例继续用Ruby的法则...?
10:window.js:https://www.refheap.com/110146
感觉有点像用Js写Ruby代码233
还是猴子补丁,一堆猴子补丁
Window_BattleLog.prototype.callNextMethod = function() { if (this._methods.length > 0) { var method = this._methods.shift(); if (method.name && this[method.name]) { this[method.name].apply(this, method.params) } else { throw new Error('Method not found: ' + method.name) } } };
Window_BattleLog.prototype.callNextMethod = function() {
if (this._methods.length > 0) {
var method = this._methods.shift();
if (method.name && this[method.name]) {
this[method.name].apply(this, method.params)
} else {
throw new Error('Method not found: ' + method.name)
}
}
};
这段代码真心诡异
全部代码打包:
mv-core-src.7z
(103.88 KB, 下载次数: 78)
Scene与Scene之间切换都没有什么鬼
数据库json文件打包:
data.zip
(19.89 KB, 下载次数: 86)
这行走图和脸图让我蛋疼的不行
Sprite的代码:
Sprite.prototype._renderWebGL = function(renderSession) { if (this.visible && this.alpha > 0) { var spriteBatch = renderSession.spriteBatch; if (this._filters) { spriteBatch.flush(); renderSession.filterManager.pushFilter(this._filterBlock); if (this.opaque) { renderSession.gl.clearColor(0, 0, 0, 1); renderSession.gl.clear(renderSession.gl.COLOR_BUFFER_BIT) } } if (this._mask) { spriteBatch.stop(); renderSession.maskManager.pushMask(this.mask, renderSession); spriteBatch.start() } spriteBatch.render(this); for (var i = 0, j = this.children.length; i < j; i++) { this.children[i]._renderWebGL(renderSession) } if (this._mask) { spriteBatch.stop(); renderSession.maskManager.popMask(this._mask, renderSession); spriteBatch.start() } if (this._filters) { spriteBatch.stop(); renderSession.filterManager.popFilter(); spriteBatch.start() } } };
Sprite.prototype._renderWebGL = function(renderSession) {
if (this.visible && this.alpha > 0) {
var spriteBatch = renderSession.spriteBatch;
if (this._filters) {
spriteBatch.flush();
renderSession.filterManager.pushFilter(this._filterBlock);
if (this.opaque) {
renderSession.gl.clearColor(0, 0, 0, 1);
renderSession.gl.clear(renderSession.gl.COLOR_BUFFER_BIT)
}
}
if (this._mask) {
spriteBatch.stop();
renderSession.maskManager.pushMask(this.mask, renderSession);
spriteBatch.start()
}
spriteBatch.render(this);
for (var i = 0, j = this.children.length; i < j; i++) {
this.children[i]._renderWebGL(renderSession)
}
if (this._mask) {
spriteBatch.stop();
renderSession.maskManager.popMask(this._mask, renderSession);
spriteBatch.start()
}
if (this._filters) {
spriteBatch.stop();
renderSession.filterManager.popFilter();
spriteBatch.start()
}
}
};
Pixi.js的同样的方法
PIXI.Sprite.prototype._renderWebGL = function(renderSession) { // if the sprite is not visible or the alpha is 0 then no need to render this element if(!this.visible || this.alpha <= 0)return; var i,j; // do a quick check to see if this element has a mask or a filter. if(this._mask || this._filters) { var spriteBatch = renderSession.spriteBatch; // push filter first as we need to ensure the stencil buffer is correct for any masking if(this._filters) { spriteBatch.flush(); renderSession.filterManager.pushFilter(this._filterBlock); } if(this._mask) { spriteBatch.stop(); renderSession.maskManager.pushMask(this.mask, renderSession); spriteBatch.start(); } // add this sprite to the batch spriteBatch.render(this); // now loop through the children and make sure they get rendered for(i=0,j=this.children.length; i<j; i++) { this.children[i]._renderWebGL(renderSession); } // time to stop the sprite batch as either a mask element or a filter draw will happen next spriteBatch.stop(); if(this._mask)renderSession.maskManager.popMask(this._mask, renderSession); if(this._filters)renderSession.filterManager.popFilter(); spriteBatch.start(); } else { renderSession.spriteBatch.render(this); // simple render children! for(i=0,j=this.children.length; i<j; i++) { this.children[i]._renderWebGL(renderSession); } } };
PIXI.Sprite.prototype._renderWebGL = function(renderSession)
{
// if the sprite is not visible or the alpha is 0 then no need to render this element
if(!this.visible || this.alpha <= 0)return;
var i,j;
// do a quick check to see if this element has a mask or a filter.
if(this._mask || this._filters)
{
var spriteBatch = renderSession.spriteBatch;
// push filter first as we need to ensure the stencil buffer is correct for any masking
if(this._filters)
{
spriteBatch.flush();
renderSession.filterManager.pushFilter(this._filterBlock);
}
if(this._mask)
{
spriteBatch.stop();
renderSession.maskManager.pushMask(this.mask, renderSession);
spriteBatch.start();
}
// add this sprite to the batch
spriteBatch.render(this);
// now loop through the children and make sure they get rendered
for(i=0,j=this.children.length; i<j; i++)
{
this.children[i]._renderWebGL(renderSession);
}
// time to stop the sprite batch as either a mask element or a filter draw will happen next
spriteBatch.stop();
if(this._mask)renderSession.maskManager.popMask(this._mask, renderSession);
if(this._filters)renderSession.filterManager.popFilter();
spriteBatch.start();
}
else
{
renderSession.spriteBatch.render(this);
// simple render children!
for(i=0,j=this.children.length; i<j; i++)
{
this.children[i]._renderWebGL(renderSession);
}
}
};
MV这个代码真的可以去死了,
现在我才意识到Scene是Stage的一种,EB你去死吧
Pixi用的v2,应该无大碍,先这样OTL |