Ejemplo n.º 1
0
        // Check if game is over
        private void checkEndCondition()
        {
            long time = DateTimeOffset.Now.ToUnixTimeMilliseconds() - milis;

            if (time > 60000)
            {
                File.AppendAllText(@"Logs.txt", id.ToString() + "|0|" + time.ToString() + "|-1\n");
                StartGame();
                return;
            }

            foreach (GridElement x in bombs)
            {
                if (x.checkCollision(player))
                {
                    File.AppendAllText(@"Logs.txt", id.ToString() + "|0|" + time.ToString() + "|" + x.getId() + "\n");
                    StartGame();
                    return;
                }
            }

            if (player.getColumn() == 9)
            {
                File.AppendAllText(@"Logs.txt", id.ToString() + "|1|" + time.ToString() + "|-1\n");
                StartGame();
                return;
            }
        }