Giter VIP home page Giter VIP logo

Comments (5)

fenomas avatar fenomas commented on September 11, 2024

Thanks! Want to submit a PR?

from ent-comp.

ineptech avatar ineptech commented on September 11, 2024

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.

fenomas avatar fenomas commented on September 11, 2024

Too late. Let me know what you're interested in adding, please, or what you think is missing!

from ent-comp.

ineptech avatar ineptech commented on September 11, 2024

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.

fenomas avatar fenomas commented on September 11, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.