acleverpun / letsgoonanadventure

Adventure game prototype built from our skeleton
0 stars 0 forks source link

Richard Nixon #25

Closed rosshadden closed 9 years ago

rosshadden commented 9 years ago

Implemented nixons.

Check out the differences between the first commit and the second commit, as I did a thing that we may not like.

Closes #18

rosshadden commented 9 years ago

P.S.: I was thinking about calling them components, but it's such a long word.

rosshadden commented 9 years ago

@oppenlander I made the nixon.update and tick stuff we talked about.

As stated here, we should come up with a way to let nixons apply to other things. Spike tiles, for instance, should apply to all Actor entities. I'd like to pass arguments to nixons, but these arguments are weird because they may not exist for a while.

rosshadden commented 9 years ago

I think I have it. Based on my changes in 21344b8744559df71c4426c718c0bbdace6f13b9:

Say we have a Phaser group for all actors, and we have a spike tile that we want to apply to all actors. SpikeTile could now have this in its init:

    init(...args) {
        super(...args);
        this.nixons.walkable.target = this.state.groups.actors;
    }

This just changes the target of the walkable tile to be all actors, instead of only the player. And the above is actually supported now :-).