Sprite Rotation

http://jsfiddle.net/p6f4w1jv/2/
How to ahceive this kind of rotaion in phaser

this.midpoint = {x:this.img.x,y:this.img.y}

function onMove(){

    let angle = 0, sp = this.startpoint, mp = this.midpoint;
    let p = {x:this.game.input.x, y:this.game.input.y};
    let sAngle = Math.atan2((sp.y-mp.y),(sp.x - mp.x));
    let pAngle = Math.atan2((p.y-mp.y),(p.x - mp.x));        

    
    angle = (  sAngle - pAngle) * 180/Math.PI;
    console.log(angle)
    this.img.rotation -= angle
    
    this.startpoint = {x:p.x, y:p.y};

}

its working weirdly and rotates faster

kindly help

I see an image of a cat rotating, not really a sprite :smile:
Are you sure you’re in the right forum ? :wink: