Comments (5)
Thanks! Want to submit a PR?
from ent-comp.
If I actually add anything I will. I've got an idea for that actually, not
sure if I'll have time to implement it...
On Sat, Apr 30, 2016 at 6:11 AM, Andy Hall [email protected] wrote:
Thanks! Want to submit a PR?
—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#1 (comment)
from ent-comp.
Too late. Let me know what you're interested in adding, please, or what you think is missing!
from ent-comp.
I was thinking of expiring components.
ecs.createComponent({
name: 'isSwingingSword',
state: { },
onRemove: function(id, state) {
ecs.addComponent(id, 'canAttack');
},
expiry: 500
});
ecs.addComponent(id, 'isSwingingSword');
ecs.tick(100);
ecs.hasComponent(id, 'isSwingingSword'); // true
ecs.getState(id, 'isSwingingSowrd').expiry; // 400
ecs.tick(401);
ecs.hasComponent(id, 'isSwingingSword'); // false
ecs.hasComponent(id, 'canAttack'); //true
Would be useful for short-lived things like attack animation, where you
need to know the time-remaining but otherwise don't have anything to put in
system(). Not hard for the user to do themselves, but seems like it'd be
so common a use case that simplifying it would be a nice addition. Not
sure if it should key off of of system time or render time, or both
(meaning, have expiry and expiryRender). Whatcha think?
On Sat, Apr 30, 2016 at 9:36 PM, Andy Hall [email protected] wrote:
Too late. Let me know what you're interested in adding, please, or what
you think is missing!—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#1 (comment)
from ent-comp.
Well, I haven't thought deeply but my first reaction is that something like that might be better left in client code? Unless there's a reason why it's better done inside the library than out (e.g. it needed to mess with internal data structures).
from ent-comp.
Related Issues (4)
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 ent-comp.