Ejemplo n.º 1
0
        public void TestPlayer()
        {
            GameImpl   gameTest   = new GameImpl();
            PlayerImpl testPlayer = new PlayerImpl(ID.PLAYER, gameTest);

            Assert.IsNotNull(testPlayer);

            Pair <int, int> position = testPlayer.Position;

            testPlayer.setSpeed(5, 5);
            testPlayer.update();

            Assert.IsTrue(testPlayer.Position.Equals(position));
        }
        public void TestGame()
        {
            GameImpl gameTest = new GameImpl();
            int      oldScore = gameTest.Score;
            int      oldLevel = gameTest.Level;

            Assert.IsNotNull(gameTest);
            Assert.IsNotNull(gameTest.Player);
            Assert.IsNotNull(gameTest.Entities);

            Assert.AreEqual(gameTest.Score, oldScore);

            Assert.AreEqual(gameTest.Status, GameStatus.RUNNING);

            Assert.AreEqual(gameTest.Level, oldLevel);

            gameTest.nextLevel();
            gameTest.nextLevel();
            gameTest.nextLevel();
            gameTest.nextLevel();
            Assert.AreNotEqual(gameTest.Level, oldLevel);
        }
Ejemplo n.º 3
0
 public GameImpl()
 {
     Instance = this;
 }
Ejemplo n.º 4
0
 public static void Main()
 {
     TextInputWrapper.Current = new TextInputWrapper.DesktopGl <TextInputEventArgs>((w, c) => w.TextInput += c);
     using var game           = new GameImpl();
     game.Run();
 }