Пример #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 WinScreen(NeonArkanoidGame game)
            : base()
        {
            _game = game;
            tm = new TweenManager();
            Tween.RegisterAccessor(typeof(Sprite), new SpriteAccessor());

            mySprite = new Sprite("../assets/sprite/ui/W1.png");
            mySprite.SetOrigin(mySprite.width / 2, mySprite.height / 2);
            AddChild(mySprite);

            mySprite2 = new Sprite("../assets/sprite/ui/W2.png");
            mySprite2.SetOrigin(0, 0);
            AddChild(mySprite2);

            myTimelime.Push(Tween.To(mySprite, SpriteAccessor.XY, 2000).Target(_game.width / 2, _game.height / 2).Ease(TweenEquations.easeInExpo));
            myTimelime.Start(tm);
            myTimelime2.Push(Tween.From(mySprite2, SpriteAccessor.XY, 2000).Target(_game.width, _game.height).Ease(TweenEquations.easeInExpo));
            myTimelime2.Start(tm);
        }