예제 #1
0
        [Test] // Testing too much speed collision with platform results in death.
        public void CollisionWithPlatformDeathTest()
        {
            _testCollisionObstacle = new EntityContainer();
            _testCollisionPlatform = new EntityContainer();
            _testSpecifiedPlatform = new List <Dictionary <char, List <Entity> > >();
            _testPassengerList     = new List <Passenger>();

            var stationaryShape = new StationaryShape(new Vec2F(0.0f, 0.0f), new Vec2F(1.0f, 0.5f));
            var image           = new Image(Path.Combine("Assets", "Images", "Taxi_Thrust_None.png"));

            _testPlayer = new Player();
            _testPlayer.SetPosition(0.5f, 0.6f);
            _testPlayer.GetsShape().Direction.Y = -0.005f;

            _testCollisionPlatform.AddStationaryEntity(stationaryShape, image);

            CollisionChecker collisionTest = new CollisionChecker(_testCollisionObstacle, _testCollisionPlatform,
                                                                  _testPlayer, _testPassengerList, _testSpecifiedPlatform);

            while (!collisionTest.GetGameOverChecker())
            {
                _testPlayer.PlayerMove();
                collisionTest.CheckCollsion();
            }
            Assert.AreEqual(collisionTest.GetGameOverChecker(), true);
        }