Hello, i was just curious about 1 thing, Does the performance change from 1.0 and 2.0? Is there a prevision of a 3.0 scripts? I ask this because if performance changes i plan to switch to 2.0 but if a 3.0 is about to come is pointless to convert it now. Thanks.
From having just done the switch from 1.0 to 2.0 for major projects Iāve got the following observations:
- Scripts 1 very much ties a script to a physical file, whereas Scripts 2.0 does not and allows you to define multiple behaviours in a single file.
Thatās allowed me to build this and make it pretty easy to use:
-
Scripts 2 defines all attributes etc without the āmagicā that existed for scripts 1. The format and syntax of these are different.
-
Scripts 2 hides the constructor (supplies it itself) so without modifying stuff you donāt get to be called before an item is enabled. (I have a patch for that in the project above because I need it)
-
Scripts 2 doesnāt make you write your scripts inside a closure supplying āappā - instead app is a property of the script
this
. -
Scripts 2 naturally can put all of your files into a single script at build so that it loads faster (note above project does this in a different way, same result)
-
Scripts 2 scripts are just another asset in your project, no special case like Scripts 1.
-
Scripts 2 normally canāt be edited locally, only through the editor and they support collaborative editing (no points for guessing Iām not a big fan of this!) Iāve made a work around in said project to allow proper version control and local editing.
On the whole Scripts 2 is a move forwards, especially for me using the above template project meaning I can integrate PC into a professional continuous integration and build process without losing the ability to use the scene editor.
Iāve no idea on Scripts 3 of course!
Thatās a pretty good summary of the differences from @whydoidoit.
We donāt currently have any plans for a Scripts 3.0.
Thanks for your explanation @whydoidoit i think your work with es6 and babel is a step above of what i can actually achieve with my level of knowledge, i am aware that my work will greatly benefit from that further step but i am still struggling with FPS performance and code optimization. If i would be able to use the engine as stand alone i would put all the game in my site and have also the advantage of the mysql archives that would lead to a faster multiplayer integration (yes i havenāt give up on make the game multiplayer). Of course with a proper team the project itself would be done very quickly and would result in something good enough to be shown in some exhibition. Since as @dave say there isnāt any plans for 3.0 i will try to bring it up to 2.0. Not sure about the success or benefit that i will get Hope someone will join me in the project. Thanks a lot.
for scripts 3.0 you could add a void functuion like this:
var Code = createPc.script(ācodeā);
void update(ācodeā) {
}
code.prototype.inititalize = function(){
}
code.prototype = update: `function(dt){
}
return code;