Advertisement
Guest User

Untitled

a guest
Apr 20th, 2012
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package  
  2. {
  3.     import Box2D.Common.Math.b2Vec2;
  4.     import Box2D.Dynamics.*;
  5.    
  6.     import flash.display.Sprite;
  7.     import org.flixel.*;
  8.     import org.flixel.easing.*;
  9.  
  10.     public class MainState extends FlxB2State
  11.     {
  12.         private var body1:FlxB2Sprite;
  13.         private var body2:FlxB2Sprite;
  14.         override public function create():void
  15.         {
  16.             super.create();
  17.             FlxG.bgColor = 0xffffffff;
  18.            
  19.             var text:FlxText = new FlxText( -100, 10, 50, "Oh Yeah!");
  20.             text.color = 0xFF0000;
  21.             add(text);
  22.            
  23.             body1 = new FlxB2Sprite(world, 25, 10);
  24.             body1.b2Type = b2Body.b2_dynamicBody;
  25.             body1.b2AngularDamping = 1;
  26.             body1.b2Friction = 1;
  27.             body1.createCircle();
  28.             //body1.fixed = true;
  29.             add(body1);
  30.            
  31.             body2 = new FlxB2Sprite(world, 50, 100);
  32.             body2.scale = new FlxPoint(2, 2);
  33.             body2.createBox();
  34.             add(body2);
  35.             FlxTween.to(text, 4, { x:150, y:150, angle:720 } , Bounce.easeOut);
  36.         }
  37.         override public function update():void
  38.         {
  39.             super.update();
  40.            
  41.         }
  42.     }
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement