示例#1
0
        public Pause(TimeGuardianGame game, LevelBase level)
        {
            _level = level;
            _game = game;

            x = -500;

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

            Sprite 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 (Button button in _buttons)
            {
                AddChild(button);
            }

            _selectedSound = new Sound(UtilStrings.SoundsMenu + "sound_selected.wav");
            _openSound = new Sound(UtilStrings.SoundsMenu + "sound_pause.wav");
        }
示例#2
0
        public GameOver(TimeGuardianGame game, LevelBase level)
        {
            _game = game;
            _level = level;
            SetBackground();
            SetHeader();
            _buttons = new[]
            {
                new Button(UtilStrings.SpritesOther + "gameover/button_restart.png", 2, 300, 550, _level.GetLevelName()),
                new Button(UtilStrings.SpritesOther + "gameover/button_exit.png", 2, game.width - 300, 550, "MainMenu")
            };
            foreach (var button in _buttons)
            {
                AddChild(button);
            }

            _buttons[0].Selected();
        }