This Blog contains About Action script 3.0 Variables, Data types, Access specifies, Keywords, Operators, Conditional statements, Control statements, Arrays (Indexed, Associative, Multidimensional, Cloning), Functions, Symbols, Movie clips (Transformation point, Registration point, Loading images), Buttons, Events (Key board, Mouse, Timer, XML)Pre- defined function :- Random, Hit test object, Drag and drop, Sort, Loader, Tween,URL Loader, Video components, Audio Components, Sound Channel.
Friday, 8 March 2013
pendulum movement in as3
Code :-
=====
var startingAngle:Number = 90;
var gravity:Number = 0.1;
var currentForce:Number = 0;
pendulum.rotation = startingAngle;
stage.addEventListener(Event.ENTER_FRAME, loop);
function loop(e:Event):void
{
currentForce -= pendulum.rotation / (gravity * 150);
pendulum.rotation += currentForce;
}
Subscribe to:
Post Comments (Atom)
eh sir why gravity not 9.81 and why grvity * 150 ?
ReplyDeletewhat the mean ?