Comments (7)
I'm not very familiar with ES6, but I would like to port b3 to it. How it is to translate es6 to es5? How we would use a Class system in the es5 if translated?
from behavior3js.
I'm currently following your tutorial for my own implementation in ES6. I will push my work on this repository.
I would like to use your lib in the future for the benefits of the editor (and merged efforts :) ), my implementation is a temporary work in the meantime because I need it now.
For documentation on ES6 and classes you can start with this page. To transpile ES6 to compatible ES5, you can use Babel, there is a live editor where you can try the new syntax and see live how it compile.
On my wip implementation, here is how the Sequence
node implementation looks like:
import State from './../constants/state';
import BaseNode from './../basenode';
export default class Sequence extends BaseNode {
constructor(childs) {
super();
this.name = 'Sequence';
this.childs = [];
childs.map(c => this.childs.push(c));
}
tick(tick) {
for (var i = 0; i < this.childs.length; i += 1) {
var status = this.childs[i].execute();
if (status !== State.SUCCESS) {
return status;
}
}
return State.SUCCESS;
}
}
from behavior3js.
I'd also like to recommend the work of Dr. Axel on both his blog and book
from behavior3js.
This issue seems to be covered by #21 (Modernize the codebase). @renatopp is it worth considering closing this issue and directing further discussion to #21?
from behavior3js.
@Oza94 would like to submit a PR to convert all classes to ES6?
from behavior3js.
Hi, @danielepolencic !
I couldn't wait so I gave it a try: #30
from behavior3js.
@Zielak made the dream come true ✨
Closing this.
from behavior3js.
Related Issues (20)
- deploy to npm HOT 6
- Question: Selector node HOT 3
- How can I load JSON from the Editor into my game?
- how to compose 2 trees HOT 1
- bower.json not well formed HOT 1
- Wishlist for behavior3 HOT 2
- Add bower install to README.md HOT 1
- Modernize the codebase HOT 3
- npm package points to old version of the lib HOT 1
- MemSequence bug? HOT 2
- decorator limiter would not limiter the time between two tick from tree HOT 6
- about Tick._openNodes HOT 2
- Zoom reverse in the editor HOT 1
- parallel support? HOT 2
- behavior3.com domain expired HOT 1
- wiki page is blank HOT 1
- add custom node
- Is it still maintained? HOT 1
- Build tasks combines classes in wrong order, breaking inheritance HOT 1
- Build tasks combines classes in wrong order, breaking inheritanc HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from behavior3js.