Exemplo n.º 1
0
Arquivo: Form1.cs Projeto: mitko0/Maze
        private void Form1_KeyUp(object sender, KeyEventArgs e)
        {
            CheckFinish();
            Point p = new Point(g.avatar.Location.X - g.avatar.r, g.avatar.Location.Y - g.avatar.r);

            if (g.bombs.Die(p))
            {
                if (g.Lifes-- > 0)
                {
                    g.CanMove     = true;
                    g.TimeCounter = 0;
                    if (g.Level < 11)
                    {
                        g.rows -= 3;
                    }
                    g.cols -= 3;
                    if (g.wdth > 20)
                    {
                        g.wdth += 2;
                    }
                    g.Level--;
                    g.LevelUp();
                    Thread.Sleep(350);
                    Generate();
                    g.bombs.Add(g.Level, g.maze.last);

                    LevelUp();
                }
                else
                {
                    GameOver(true);
                }
            }
        }