コード例 #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));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public GameImpl()
 {
     Instance = this;
 }
コード例 #4
0
ファイル: Program.cs プロジェクト: Ellpeck/GameBundle
 public static void Main()
 {
     TextInputWrapper.Current = new TextInputWrapper.DesktopGl <TextInputEventArgs>((w, c) => w.TextInput += c);
     using var game           = new GameImpl();
     game.Run();
 }