コード例 #1
0
 public void UpdateSpriteSheet(float deltaTime)
 {
     _playerFallingSpriteSheet.Update(deltaTime);
     _spriteSheetPosition.X = _playerGameObject.Position.X;
     _spriteSheetPosition.Y = _playerGameObject.Position.Y - _playerGameObject.Sprite.Height / 2.0f;
     _playerFallingSpriteSheet.Sprite.Position = _spriteSheetPosition;
 }
コード例 #2
0
        public override bool Update(float deltaTime, float gameTime)
        {
            if (_screenActive)
            {
                switch (_cinematicState)
                {
                case CinematicState.StageDisplay:
                    UpdateStageDisplay(deltaTime);
                    break;

                case CinematicState.PlayerMoveToPosition:
                    UpdatePlayerMoveToPosition(deltaTime);
                    break;

                case CinematicState.Climbing:
                    UpdatePlayerClimbing(deltaTime);
                    break;

                case CinematicState.PlayerReachedTop:
                    UpdatePlayerReachedTop(deltaTime);
                    break;

                case CinematicState.PlayerJump:
                    UpdatePlayerJump(deltaTime);
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }

                foreach (Audience audience in _audiences)
                {
                    audience.Update(deltaTime, gameTime);
                }
            }

            _booTimer -= deltaTime;
            if (_booTimer <= 0)
            {
                _booTimer = ExtensionFunctions.RandomInRange(GameInfo.CinematicBooMinTime,
                                                             GameInfo.CinematicBooMaxTime);
                SoundManager.Instance.PlaySound(_booSoundEffect);
            }

            _starSpriteSheetAnimationManager.Update(deltaTime);
            _playerSprite.SpriteColor = _playerFlasher.Update(deltaTime);

            return(_exitScreen);
        }
コード例 #3
0
ファイル: MainScreen.cs プロジェクト: Awesomeosity/Team-Rock
        private void UpdateEndStateAnimations(float deltaTime)
        {
            _endExplosion.Update(deltaTime);
            _confetti1.Update(deltaTime);
            _confetti2.Update(deltaTime);
            if (!_endExplosion.IsAnimationActive)
            {
                _timeToGameOver -= deltaTime;
            }

            if (_timeToGameOver <= 0)
            {
                _screenActive = false;
                Fader.Instance.StartFadeIn();

                SetGameState(GameState.GameOver);
            }
        }
コード例 #4
0
ファイル: MainScreen.cs プロジェクト: Awesomeosity/Team-Rock
        public override bool Update(float deltaTime, float gameTime)
        {
            if (_screenActive)
            {
                UpdateFillBarColor(deltaTime);
                _starSpriteSheetAnimationManager.Update(deltaTime);

                switch (_gameState)
                {
                case GameState.IsRunning:
                    UpdateGameEndTimer(deltaTime);
                    UpdatePlayerRacingTimer(deltaTime);
                    UpdateGameObjectsBeforeTime(deltaTime, gameTime);
                    break;

                case GameState.EndStarted:
                    UpdateStageAndPlayerEndState(deltaTime, gameTime);
                    break;

                case GameState.EndAnimations:
                    UpdateEndStateAnimations(deltaTime);
                    break;

                case GameState.GameOver:
                    // Don't do Anything
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }

                foreach (Audience audience in _audiences)
                {
                    audience.Update(deltaTime, gameTime);
                }
            }

            return(_exitScreen);
        }