Пример #1
0
        public Pause(NeonArkanoidGame game, Level.Level level)
        {
            _level = level;
            _game = game;

            x = -500;

            var background = new Sprite(UtilStrings.SpritesPause + "background_pause.png");
            background.SetOrigin(0, background.height/2);
            background.y = game.height/2;

            var header = new Sprite(UtilStrings.SpritesPause + "header_pause.png");
            header.SetOrigin(header.width/2, header.height/2);
            header.SetXY(background.width/2, 200);

            _buttons = new[]
            {
                new Button(UtilStrings.SpritesPause + "button_resume.png", 2, background.width/2, 350, "Resume"),
                new Button(UtilStrings.SpritesPause + "button_restart.png", 2, background.width/2, 450,
                    _level.GetLevelName()),
                new Button(UtilStrings.SpritesPause + "button_exit.png", 2, background.width/2, 550, "MainMenu")
            };

            AddChild(background);
            AddChild(header);
            foreach (var button in _buttons)
            {
                AddChild(button);
            }

            _selectedSound = new Sound(UtilStrings.SoundsMenu + "sound_selected.wav");
            _openSound = new Sound(UtilStrings.SoundsMenu + "sound_pause.wav");
        }
Пример #2
0
        public Button(string filename, int rows, int x, int y, string state)
            : base(filename, 1, rows)
        {
            DeSelect();
            SetOrigin(game.width/2 - 60, height/2 - 30);
            SetXY(x, y);
            _state = state;

            _selectSound = new Sound(UtilStrings.SoundsMenu + "sound_click.wav");
        }
Пример #3
0
        public Credits(NeonArkanoidGame game)
            : base()
        {
            _game = game;
            SetBackground();

            _buttons = new[]
               {
                new Button(UtilStrings.SpritesMenu + "/Credits/back.png", 2, 1500, 680, "MainMenu"),
            };
            foreach (var button in _buttons)
            {
                AddChild(button);
            }
            _buttons[0].Selected();

            _selectedSound = new Sound(UtilStrings.SoundsMenu + "sound_selected.wav");
        }
Пример #4
0
 public MainMenu(NeonArkanoidGame game)
 {
     _game = game;
     SetBackground();
     SetHeader();
     _buttons = new[]
     {
         new Button(UtilStrings.SpritesMenu + "Start.png", 2, 1500, 207, "Level1"),
         new Button(UtilStrings.SpritesMenu + "credits.png", 2, 1498, 370, "Credits"),
         new Button(UtilStrings.SpritesMenu + "quit.png", 2, 1502, 537, "Exit")
     };
     foreach (var button in _buttons)
     {
         AddChild(button);
     }
     _buttons[0].Selected();
     _selectedSound = new Sound(UtilStrings.SoundsMenu + "sound_selected.wav");
     var music = new Sound(UtilStrings.SoundsMenu + "Menu.ogg", true, true);
     _musicChannel = music.Play();
 }
Пример #5
0
 private void SetSounds()
 {
     _hitPoly = new Sound(UtilStrings.SoundsLevel + "1_tile hit.wav");
     _hitPaddle = new Sound(UtilStrings.SoundsLevel + "1_pedal hit.wav");
     _music = new Sound(UtilStrings.SoundsLevel + "8.wav", true, true);
     _musicChannel = _music.Play();
 }