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); }
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); }
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(); }
public GameObject(Point pos, Game g) { Position = pos; Game = g; }
public Door(Point pos, Game g) : base(pos, g) { }
public Explosion(Point pos, Game g, int t) : base(pos, g) { timer = t; }
public Walker(Point pos, Game g) : base(pos, g) { }
public Enemy(Point pos, Game g) : base(pos, g) { }
public MetallWall(Point pos, Game g) : base(pos, g) { }
public BrickWall(Point pos, Game g) : base(pos, g) { }
public Bomb(Point pos, Game g, int t) : base(pos, g) { timer = t; }
public Player(Point pos, Game g) : base(pos, g) { }