Example #1
0
 public Dying()
 {
     _rotateX = new RotateX(0, MathHelper.PiOver2, 600);
     _rotateX.EaseFunction = EaseFunction.In_Cubic;
     _rotateX.OnEnd += _rotateX_OnEnd;
     _fade = new Fade(1.0f, 0.0f, 3000);
     _fade.OnEnd += _fade_OnEnd;
 }
Example #2
0
 public Board(string texName, UnitCamera cam)
     : base(Constants.TIME_TICKS_EVENT)
 {
     var tex = XNADevicesManager.Instance.ContentManager.Load<Texture2D>(texName);
     _unitCam = cam;
     _sprite = new Sprite(tex);
     _sprite.DrawRectangle = new Rectangle(0, 0, tex.Width, tex.Height);
     _sprite.IsVisible = false;
     _fade = new Fade(0.0f, 1.0f, 1000);
     _fade.Target = _sprite;
     _scale = new Scale(0.2f, 1.0f, 0.2f, 1.0f, 1000);
     _scale.Target = _sprite;
 }
Example #3
0
        public HPBar(string frameTexName, string rectTexName)
        {
            var frameTex = XNADevicesManager.Instance.ContentManager.Load<Texture2D>(frameTexName);
            var rectTex = XNADevicesManager.Instance.ContentManager.Load<Texture2D>(rectTexName);

            _hpFrame = new Sprite(frameTex);
            _hpFrame.Z = 2.0f;
            _hpFrame.DrawRectangle = new Rectangle(0, 0, frameTex.Width, frameTex.Height);
            _hpFrame.TransformOrigin = new Vector2(0.0f, 1.0f);
            _hpFrame.IsVisible = false;
            _hpRect = new Sprite(rectTex);
            _hpRect.Z = 1.0f;
            _hpRect.DrawRectangle = new Rectangle(0, 0, rectTex.Width, rectTex.Height);
            _hpRect.TransformOrigin = new Vector2(0.0f, 1.0f);
            _hpRect.IsVisible = false;
            _fade = new Fade(0, 1.0f, 400);
            _fade.Target = _hpFrame;
        }
        private void LoadIntro()
        {
            _clearScreen = new Sprite(XNADevicesManager.Instance.ContentManager.Load<Texture2D>("black1x1"));
            _clearScreen.DrawRectangle = new Rectangle(0, 0, 1, 1);
            _clearScreen.Position = _player1.Sprite.Position;
            _clearScreen.Z = 315;
            _clearScreen.ScaleX = 4096.0f;
            _clearScreen.ScaleY = 4096.0f;
            Root.Add(_clearScreen);

            _fadeScreen = new Fade(1.0f, 0.0f, 2000);
            _fadeScreen.EaseFunction = EaseFunction.In_Cubic;
            _fadeScreen.Target = _clearScreen;
            _fadeScreen.OnEnd += s => { _clearScreen.IsVisible = false; };

            _boardTexs = new string[4];
            _boardTexs[0] = "intro0";
            _boardTexs[1] = "intro1";
            _boardTexs[2] = "intro2";
            _boardTexs[3] = "intro3";

            _board = new Board(_boardTexs[0], _unitCam);
            _board.Distance = 285;
            _board.OnHide += (s, e) => { Pause = false; };
            Root.Add(_board.Sprite);

            var logo = new Logo("logo", _unitCam);
            logo.Distance = 284;
            logo.Show();
            AuditionManager.Instance.PlayBGM("surrounded");
            Root.Add(logo.Sprite);

            _startTimer = new Timer(5500);
            _startTimer.OnTimer += sender =>
            {
                _fadeScreen.Start();
                Pause = false;
                _introTimer.Start();
            };
            _startTimer.Start();

            _introTimer = new Timer(1000);
            _introTimer.OnTimer += sender =>
            {
                _board.SwitchTex(_boardTexs[_countBoard]);
                _board.Show();
                Pause = true;
            };

            Pause = true;
        }