Hashasm 1 Report post Posted April 5, 2017 hi guys someone please help me to upgrade this file to newer version of melon js.. inventory.js Share this post Link to post Share on other sites
spinnerbox 26 Report post Posted April 5, 2017 Without seeing and knowing the code in the file or even MelonJs, the first thing to do is to update your local repository of MelonJs where you downloaded it. And then you check the docs of the new version of Melonjs and go part by part and update your file which depends on Melonjs. But there is no chance I or any other will go trough that 560 lines file and debug it for the code you have. Learn the file internally how it works and then add changes appropriatelly. Also when this sort of thing happens, and you need to update existing code to a newer version of a tool used in it, I would use source code versioning system, like SVN/VisualSVN/TortoiseSVN or Git/Github with Git shell installed locally. This will help you save the current version of the file and also save the upcomming changes. And will enable you to revert back some of the changes to a previous version. 1 obiot reacted to this Share this post Link to post Share on other sites
obiot 26 Report post Posted April 6, 2017 we have a wiki page that we maintain on this purpose : https://github.com/melonjs/melonJS/wiki/Upgrade-Guide also, there is some good upgrade guide made by Cian Games (unfortunaly they stop at version 2.x though) : http://blog.ciangames.com/2014/08/upgrading-to-melonjs-10.html http://blog.ciangames.com/2014/09/upgrading-to-melonjs-11.html http://blog.ciangames.com/2014/11/upgrading-to-melonjs-20.html http://blog.ciangames.com/2015/05/upgrading-to-melonjs-21.html and generally speaking I would definitely check our wiki page, as it contains tons of informations and how-to on various topics (especially the 3rd-party tools section) : https://github.com/melonjs/melonJS/wiki 1 spinnerbox reacted to this Share this post Link to post Share on other sites
Hashasm 1 Report post Posted April 6, 2017 yeah thanks for the links i already surf through wiki pages but i didt find newer version method like // Old Code -> New Code me.game.remove -> me.game.world.removeChild me.game.add -> me.game.world.addChild me.game.collide -> me.game.world.collide me.game.getEntityByProp -> me.game.world.getChildByProp me.save.delete -> to me.save.remove me.entityPool.newInstanceOf -> me.pool.pull me.entityPool.add -> me.pool.register me.Rect.set -> me.Rect.setShape me.Font.set -> me.Font.setFont this so i struck . thanks Share this post Link to post Share on other sites
Parasyte 12 Report post Posted April 6, 2017 That's an oversimplification of some of the changes that have been made. Don't expect to just rename functions and have things work. The arguments type, order, and other requirements can also change. The Upgrade Guide is the best place to get the full picture of how the engine has evolved over time, and how you can adapt old code to the newer engine. Share this post Link to post Share on other sites