コード例 #1
0
        public void Activate()
        {
            if ((!Visible) && (MotionEngine == null))
            {
                Reset();

                _entryMotionEngine.Activate();
                MotionEngine = _entryMotionEngine;

                Visible = true;
            }
        }
コード例 #2
0
        public virtual void Activate(bool skipEntrySequence)
        {
            Reset();

            _exitMotionEngine.TargetWorldPosition = new Vector2(0.0f, WorldPosition.Y);

            if (skipEntrySequence)
            {
                WorldPosition = new Vector2(WorldPosition.X, _topYWhenActive);
                MotionEngine  = null;
                Active        = true;
            }
            else
            {
                _entryMotionEngine.TargetWorldPosition = new Vector2(0.0f, _topYWhenActive);
                _entryMotionEngine.Activate();
                MotionEngine = _entryMotionEngine;
            }

            Visible = true;
        }
コード例 #3
0
        public void Activate(Definitions.PowerUp selectedPowerUp)
        {
            switch (selectedPowerUp)
            {
            case Definitions.PowerUp.Boots: _timerDurationInMilliseconds = Boots_Duration_In_Milliseconds; break;

            case Definitions.PowerUp.Chilli: _timerDurationInMilliseconds = Chilli_Duration_In_Milliseconds; break;

            default: _timerDurationInMilliseconds = 0; break;
            }

            if (_timerDurationInMilliseconds > 0)
            {
                _entryMotionEngine.Activate();
                MotionEngine = _entryMotionEngine;

                _iconTexture = TextureManager.Textures[string.Concat("power-", selectedPowerUp).ToLower()];

                Visible = true;
            }
        }
コード例 #4
0
        public void Activate(bool skipEntrySequence)
        {
            Reset();

            _exitMotionEngine.TargetWorldPosition = new Vector2(0.0f, Definitions.Back_Buffer_Height);

            if (skipEntrySequence)
            {
                WorldPosition = new Vector2(WorldPosition.X, TopYWhenActive);
                MotionEngine  = null;
                Active        = true;
            }
            else
            {
                _entryMotionEngine.TargetWorldPosition = new Vector2(0.0f, TopYWhenActive);
                _entryMotionEngine.Activate();
                MotionEngine = _entryMotionEngine;
            }

            Visible = true;
        }