9 years ago by myvertigo
Hello everyone.
I have juste created a plugin that allow you to use ES6 features with impactJS.
https://github.com/myvertigo/impactES6
Here is an example of difference between classic impactJS file and impactES6 file
Classic
ImpactES6
There is lots of cool features with ES6 like classes, arrow function, array map/find/reduce etc.
This plugin is actually at a beta version and it is not possible to have old impactJS scripts. So I recommand you to use this plugin with a new game project.
I hope you will like it. Feel free to contribute to the project or report bugs to improve the plugin.
Sorry for my bad English.
I have juste created a plugin that allow you to use ES6 features with impactJS.
https://github.com/myvertigo/impactES6
Here is an example of difference between classic impactJS file and impactES6 file
Classic
ig.module('game.entities.player')
.requires('impact.entity')
.defines(function () {
EntityPlayer = ig.Entity.extend({
ready: false,
init: function (x, y, settings) {
this.parent(x, y, settings);
this.ready = true;
});
});
ImpactES6
import Class from "lib/impactES6/Class";
ig.require('impact.entity'); // ig.require is used only for require an impact library
export default class EntityPlayer extends Class.inheritance(ig.Entity) {
init (x, y, settings)
{
super.init(x, y, settings);
this.ready = true;
}
}
There is lots of cool features with ES6 like classes, arrow function, array map/find/reduce etc.
This plugin is actually at a beta version and it is not possible to have old impactJS scripts. So I recommand you to use this plugin with a new game project.
I hope you will like it. Feel free to contribute to the project or report bugs to improve the plugin.
Sorry for my bad English.
