Animation - Swing


/ Published in: ActionScript 3
Save to your folder(s)

Simple swing animation logic


Copy this code and paste it in your HTML
  1. var force = 20;
  2. var t = 0;
  3.  
  4. function swing()
  5. {
  6. t += 0.3;
  7. this._rotation = Math.cos(t) * force;
  8. }

Report this snippet


Comments


You need to login to view comments.