geleto

Members
  • Content Count

    3
  • Joined

  • Last visited

Posts posted by geleto


  1. ... I've found a solution:

    game.RotatableEntity = me.Entity.extend({
        init: function(x, y, sprite) {
            this._super(me.Entity, "init", [x, y, {
                width: sprite.width,
                height: sprite.height
            }]);
            this.renderable = sprite;
            this.currentAngle = 0;
            this.prevAngle = 0;
        },
        update: function() {
            this.renderable.currentTransform.rotate(this.currentAngle-this.prevAngle);
            this.prevAngle = this.currentAngle;
            return true;
        }
    });