Beispiel #1
0
        public void TestHandleCollisionPlayerEnemy()
        {
            var game = new Game();
            var player = new Player(new Point(1, 1), game);
            var enemy = new Enemy(new Point(1, 1), game);

            bool expected = true;

            player.HandleCollision(enemy);

            var actual = player.IsDie;

            Assert.AreEqual(expected, actual);
        }
Beispiel #2
0
        public void TestHandleCollisionPlayerWall()
        {
            var game = new Game();
            var player = new Player(new Point(1, 0), game);
            var wall = new BrickWall(new Point(1, 0), game);

            var expected = player.PrevPosition;

            player.HandleCollision(wall);

            var actual = player.Position;

            Assert.AreEqual(expected, actual);
        }
Beispiel #3
0
        public static void Main()
        {
            var game = new Game();
            Drawing.Game = game;
            game.Load("..\\..\\map.cs");

            // Q (quit)
            while (!game.IsGameOver && GetAsyncKeyState(0x51) == 0 )
            {
                game.ProcessObjects();
                Drawing.DrawField();
                Drawing.ShowField();
                Console.SetCursorPosition(0, 0);
            }

            Console.WriteLine("Game over!");
            Console.ReadLine();
        }
Beispiel #4
0
 public GameObject(Point pos, Game g)
 {
     Position = pos;
     Game = g;
 }
Beispiel #5
0
 public Door(Point pos, Game g)
     : base(pos, g)
 {
 }
Beispiel #6
0
 public Explosion(Point pos, Game g, int t)
     : base(pos, g)
 {
     timer = t;
 }
Beispiel #7
0
 public Walker(Point pos, Game g)
     : base(pos, g)
 {
 }
Beispiel #8
0
 public Enemy(Point pos, Game g)
     : base(pos, g)
 {
 }
Beispiel #9
0
 public MetallWall(Point pos, Game g)
     : base(pos, g)
 {
 }
Beispiel #10
0
 public BrickWall(Point pos, Game g)
     : base(pos, g)
 {
 }
Beispiel #11
0
 public Bomb(Point pos, Game g, int t)
     : base(pos, g)
 {
     timer = t;
 }
Beispiel #12
0
 public Player(Point pos, Game g)
     : base(pos, g)
 {
 }