示例#1
0
        public AppearingChar(MatchOption matchOption)
        {
            PosX = -1;
            PosY = -1;
            Random rnd = new Random();

            int len = matchOption.charactersSet.Length;

            character = matchOption.charactersSet[rnd.Next(len)];

            if (matchOption.chanceBombElement != 0)
            {
                if (rnd.Next(10) < matchOption.chanceBombElement)
                {
                    counter = rnd.Next(matchOption.maxBombCounterElement) + 1;
                }
                else
                {
                    counter = 1;
                }
            }
            else
            {
                counter = 1;
            }
        }
示例#2
0
        public EndGameView(int _points, Song _song, MatchOption _matchOptions)
        {
            points       = _points;
            song         = _song;
            matchOptions = _matchOptions;


            Elements.Add("title", new ViewElement(20, 4, 10, 1, new List <string>()
            {
                "KONIEC GRY"
            }));
            Elements.Add("playAgain", new ViewElement(20, 10, 15, 1, new List <string>()
            {
                "Zagraj ponownie"
            }));
            Elements.Add("backToMenu", new ViewElement(20, 12, 14, 1, new List <string>()
            {
                "Powrót do menu"
            }));
            Elements.Add("exit", new ViewElement(20, 14, 11, 1, new List <string>()
            {
                "Wyjdź z gry"
            }));

            Elements.Add("points", new ViewElement(20, 20, 6, 2, new List <string>()
            {
                @"WYNIK:",
                @"" + points.ToString()
            }
                                                   ));
            selectedElement = Elements[list[0]];

            init();
        }
示例#3
0
        private void EnterAction()
        {
            //set matchoptions
            //Audio.StartSong(selectedSong);
            t.Abort();
            exit = true;
            MatchOption matchOption = new MatchOption(selectedSong.song);

            matchOption.nickname = nickname;
            Game game = new Game(matchOption, selectedSong.song);
            //game.play();
        }
示例#4
0
 public Game(MatchOption _matchOption, Song _song)
 {
     matchOpttions           = _matchOption;
     song                    = _song;
     playerName              = matchOpttions.nickname;
     points                  = 0;
     progresBarValue         = matchOpttions.progresBarValue;
     timer                   = new GameTimer(song.duration, this);
     keyTimer                = new KeyTimer(this);
     view                    = new GameView();
     gameOverByUserInterrupt = false;
     gameOverProcesDone      = false;
     play();
 }