Actor > Tweening > rotation

Introduction
Each of us is facing different direction in the world so does many vehicles in the real wirld heading to various locations. And also in top-down games, turret guns do rotate to shoot enemies so does the player and its guns to shoot enemies. 

it has also been used in our so-called endless scene https://stencyl-nator.blogspot.com/p/endless-scenes.html to remove repitition. 

Note. 

Snippet

Previrew code in ;design mode
actor.spinTo(90, 0, Easing.linear);

computational shortcut level 1: 
actor.tweenProps.angle.tween(actor.getAngleInDegrees(), 90, Easing.linear,0);

finalised computational shortcut for instant rotation - bypass tween manager and timing. 
actor.tweenProps.angle.value = 90;  
if(actor.tweenProps.angle.onUpdate != null){actor.tweenProps.angle.onUpdate();}
if(actor.tweenProps.angle.onComplete != null){actor.tweenProps.angle.onComplete();} */

No comments:

Post a Comment