Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Set variables as zero
- fMov = 0;
- aDrag = 0;
- gDrag = 0;
- totalF = 0
- function moveStuff() {
- //Get values from text fields
- fMov = fmov.text;
- aDrag = adrag.text;
- // Calculate total force
- totalF = fMov - ( aDrag + gDrag );
- // Show total force
- totalf.text = totalF;
- if ( totalF > 0 )
- {
- // if total force is greater than zero, rotate rectangle
- rect._rotation += totalF;
- }
- }
- rect.onEnterFrame = moveStuff;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement