Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

10 years ago by Asim

hi,

an entity of mine can exist in two orientations: upright and upside-down.. for this, im using a flag isFlipped.. the flag can be set via weltmeister which will determine the entity's orientation through-out its lifespan.. the update method looks like:

update: function() {
    this.parent();
    this.currentAnim.flip.y = this.isFlipped;
}

however there are two issues with this approach:
1. there is a jitter evey time i switch animations in the check() function (the animation appears upright for a fraction of a second before being flipped..
2. the weltmeister shows the entity always shows the entity in its upright position until the level is reloaded..

ideally, i'd like:
1. not to define multiple entities and animation sheets (one for upright, another for upside-down)..
2. if i specify isFlipped value in weltmeister, the entity image should update to reflect the inverted/upright state..

is there a way to accomplish this?

10 years ago by TC

Had this problem a while back.

I believe adding

this.currentAnim.flip.y = this.isFlipped;

before this.parent() in your draw function will solve the weltmeister problem and also the delay.

TC
Page 1 of 1
« first « previous next › last »