public MainWindow()
        {
            InitializeComponent();

            media_elements = new List<MediaElement>();
            //mediaElement1.Source = new Uri(@"..\..\Sounds\pacman_song1.wav", UriKind.Relative);
            //mediaElement2.Source = new Uri(@"..\..\Sounds\pacman_death.wav", UriKind.Relative);
            //mediaElement3.Source = new Uri(@"..\..\Sounds\pacman_getghost.wav", UriKind.Relative);
            //mediaElement4.Source = new Uri(@"..\..\Sounds\pacman_extralife.wav", UriKind.Relative);
            //mediaElement5.Source = new Uri(@"..\..\Sounds\pacman_coinin.wav", UriKind.Relative);
            //mediaElement6.Source = new Uri(@"..\..\Sounds\pacman_background1.wav", UriKind.Relative);
            //mediaElement7.Source = new Uri(@"..\..\Sounds\pacman_alarm1.wav", UriKind.Relative);
            media_elements.Add(mediaElement1);
            media_elements.Add(mediaElement2);
            media_elements.Add(mediaElement3);
            media_elements.Add(mediaElement4);
            media_elements.Add(mediaElement5);
            media_elements.Add(mediaElement6);
            media_elements.Add(mediaElement7);
            media_elements.Add(mediaElement8);
            media_elements.Add(mediaElement9);

            WPFElements elements = new WPFElements(gridDots, gridPacman, gridSubmitScore, gridSubmitScore,
                gridPacmanLifes, gridFruits, labelScore, labelHighScore, labelGetReady, labelSubmitScore, media_elements);


            game = new TheGame(elements);

            // TODO
            // Options - Volume

            // Dźwięki DotEat/Background przy skręcaniu
            // Loop dzwiekow

            // Bug duszków przy zmianie modu na frightened/wyjście z frightened
            // Istnieje mała szansa że duch odwróci kierunek tak ze przejdzie przez ściane

            // 
        }
Exemple #2
0
        public void init(WPFElements e, Ghosts g, Pacman p, Maze m)
        {
            _level = 1;
            _score = 0;
            _pacman_lifes = 0;
            _points_for_extra_life = 500;

            _labelScore = e.labelScore;
            _labelSubmitScore = e.labelSubmitScore;
            _labelGetReady = e.labelGetReady;
            _labelHighscore = e.labelHighscore;

            _ghosts = g;
            pacman = p;
            _maze = m;

            _grid_pacman = e.gridPacman;
            _grid_highscore = e.gridHighscore;
            _grid_pacman_lifes = e.gridPacmanLifes;
            _grid_fruits = e.gridFruits;

            // Create pacman's life images
            _lifes_images = new List<Image>();
            for (int i = 0; i < _pacman_lifes; i++ )
            {
                addLifeImg(i);
            }
            _fruits_images = new List<Image>();

            // Fruit img
            addFruitImg();

            setup();

            _highscore = Int32.Parse(DataBase.Instance.getHighScore());
            _labelHighscore.Content = String.Format("{0:n0}", _highscore);
        }
Exemple #3
0
 public TheGame(WPFElements e)
 {
     elements = e;
     SoundEffect.Instance.init(elements.media_elements);
 }