darlingjs / darlingjs Goto Github PK
View Code? Open in Web Editor NEWComponent & entity based javascript game engine. With dependency injections, and modular architecture.
Home Page: http://darlingjs.github.io
License: Other
Component & entity based javascript game engine. With dependency injections, and modular architecture.
Home Page: http://darlingjs.github.io
License: Other
concept
var recipe = darling.recipe(function(pipeline, ops) {
return pipeline
.pipe(system1(ops.system1))
.pipe(system2(ops.system2));
});
Tap into the pipeline chain in order to perform operations on intermediate results within the chain
concept
darling.world()
.pipeline(system1())
.pipeline({
tap: function(entities, interval, world) {
//do some magic in between system1 and system2
}
})
.pipeline(system2());
because update system only needed for realtime games but turn based games require other approach. Make it more like stream of gulp
Example:
request target for entities with ai
.
concept
//version A
world
.require('target')
.pipe(dosometing())
.pipe(onemore())
.live(once())
//version B
entities
.catch('target')
.pipe(dosometing())
.pipe(onemore())
.live(once())
//version C
world
.filter('target')
.pipe(dosometing())
.pipe(onemore())
.live(once())
support such use case:
darling.system({
lazy: true,
updateAll: function(entities) {
return new Promise((resolve, reject) => {
//TODO: do some lazy job
});
}
})
make that modules won't require explicit description in deps of a world and connect them to the world automatic.
package.json
and bower.json
Box2D
and Vec2
The documention indicates that the fps can be specified when creating the world object.... but from what I can tell the rate is dictated by the window.requestAnimationFrame function.
useful to create common recipes for modules
concept:
var recipe = function(ops) {
return {
ops: ops,
sequence: [
system1,
system2
]
};
};
alternative:
var recipe = darling.recipe(function(pipeline, ops) {
return pipeline
.pipe(system1(ops.system1))
.pipe(system2(ops.system2));
});
alternative 2:
var recipe = darling.recipe.sequence([
system1(),
system2()
]);
usage:
darling.world()
.pipe(recipe({
system1: 'query',
system2: 123
})
.pipe(doSomething());
inspired by interfaces of https://github.com/rvagg/through2 and https://github.com/phated/undertaker
$
here is explanation who to fix olivierlacan/keep-a-changelog#71 (comment)
modify/add component trigger event, ever if we have component before
like $e, $update, etc
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.