Ejemplo n.º 1
0
        protected override void Initialize()
        {
            physicsSimulator = new PhysicsSimulator(new Vector2(0, 0));

            _agent = new Agent(ScreenCenter);
            _agent.CollisionCategory = CollisionCategory.Cat5;
            _agent.CollidesWith = CollisionCategory.All & ~CollisionCategory.Cat4; //collide with all but Cat4(black)
            _agent.Load(this, physicsSimulator);

            LoadCircles();
            controlledBody = _agent.Body;
        }
Ejemplo n.º 2
0
        protected override void Initialize()
        {
            physicsSimulator = new PhysicsSimulator(new Vector2(0, 150));
            PhysicsSimulator.MaxContactsToDetect = 5;
            physicsSimulator.MaxContactsToResolve = 2;
            physicsSimulator.Iterations = 10;
            physicsSimulator.BiasFactor = .4f;

            _agent = new Agent(ScreenCenter - new Vector2(200, 0));
            _agent.CollisionCategory = CollisionCategory.Cat5;
            _agent.CollidesWith = CollisionCategory.All & ~CollisionCategory.Cat4; //collide with all but Cat5(black)
            _agent.Load(this, physicsSimulator);
            _agent.Body.LinearDragCoefficient = .001f;
            controlledBody = _agent.Body;
            AddAgentToCanvas(_agent.Body);
            LoadSpiders();
        }
Ejemplo n.º 3
0
        protected override void Initialize()
        {
            physicsSimulator = new PhysicsSimulator(new Vector2(0, 200));
            PhysicsSimulator.MaxContactsToDetect = 2;
            //for stacked objects, simultaneous collision are the bottlenecks so limit them to 2 per geometric pair.

            _agent = new Agent(new Vector2(ScreenCenter.X, 100));
            _agent.CollisionCategory = CollisionCategory.Cat5;
            _agent.CollidesWith = CollisionCategory.All & ~CollisionCategory.Cat4; //collide with all but Cat4
            _agent.Load(this, physicsSimulator);
            AddAgentToCanvas(_agent.Body);
            LoadPlatforms();
            controlledBody = _agent.Body;
        }