public override void LoadContent() { base.LoadContent(); World.Gravity = new Vector2(0f, 20f); _border = new Border(World, this, ScreenManager.GraphicsDevice.Viewport); _agent = new Agent(World, this, new Vector2(-6.9f, -11f)); LoadObstacles(); SetUserAgent(_agent.Body, 1000f, 400f); }
public override void LoadContent() { base.LoadContent(); World.Gravity = Vector2.Zero; _border = new Border(World, this, ScreenManager.GraphicsDevice.Viewport); //Cat1=Circles, Cat2=Rectangles, Cat3=Gears, Cat4=Stars _agent = new Agent(World, this, Vector2.Zero); //Collide with all but stars _agent.CollisionCategories = Category.All & ~Category.Cat4; _agent.CollidesWith = Category.All & ~Category.Cat4; Vector2 startPosition = new Vector2(-20f, -11f); Vector2 endPosition = new Vector2(20, -11f); _circles = new Objects(World, this, startPosition, endPosition, 15, 0.6f, ObjectType.Circle); //Collide with itself only _circles.CollisionCategories = Category.Cat1; _circles.CollidesWith = Category.Cat1; startPosition = new Vector2(-20, 11f); endPosition = new Vector2(20, 11f); _rectangles = new Objects(World, this, startPosition, endPosition, 15, 1.2f, ObjectType.Rectangle); //Collides with itself only _rectangles.CollisionCategories = Category.Cat2; _rectangles.CollidesWith = Category.Cat2; startPosition = new Vector2(-20, 7); endPosition = new Vector2(-20, -7); _gears = new Objects(World, this, startPosition, endPosition, 5, 0.6f, ObjectType.Gear); //Collides with stars _gears.CollisionCategories = Category.Cat3; _gears.CollidesWith = Category.Cat3 | Category.Cat4; startPosition = new Vector2(20, 7); endPosition = new Vector2(20, -7); _stars = new Objects(World, this, startPosition, endPosition, 5, 0.6f, ObjectType.Star); //Collides with gears _stars.CollisionCategories = Category.Cat4; _stars.CollidesWith = Category.Cat3 | Category.Cat4; SetUserAgent(_agent.Body, 1000f, 400f); }
public override void LoadContent() { base.LoadContent(); World.Gravity = new Vector2(0f, 20f); _border = new Border(World, this, ScreenManager.GraphicsDevice.Viewport); _agent = new Agent(World, this, new Vector2(0f, 10f)); _spiders = new Spider[8]; for (int i = 0; i < _spiders.Length; i++) { _spiders[i] = new Spider(World, this, new Vector2(0f, 8f - (i + 1) * 2f)); } SetUserAgent(_agent.Body, 1000f, 400f); }