private void UpdateStageAndPlayerEndState(float deltaTime, float gameTime) { if (_stage.Position.Y > GameInfo.FixedWindowHeight - 100) { _stage.Velocity = -Vector2.UnitY * GameInfo.StageMoveUpSpeed; _stage.Update(deltaTime, gameTime); _winWrestler.Velocity = -Vector2.UnitY * GameInfo.StageMoveUpSpeed; _winWrestler.Update(deltaTime, gameTime); _starSprite.Position = _winWrestler.Position - _starsOffset; } _player.GameObject.Velocity = Vector2.UnitY * GameInfo.PlayerMaxYVelocity; _player.GameObject.Update(deltaTime, gameTime); _player.UpdateSpriteSheet(deltaTime); if (_player.GameObject.DidCollide(_stage)) { _endExplosion.StartSpriteAnimation(); _endExplosion.Sprite.Position = _player.GameObject.Position; _confetti1.StartSpriteAnimation(); _confetti1.Sprite.Position = _player.GameObject.Position + new Vector2(100, 0); _confetti2.StartSpriteAnimation(); _confetti2.Sprite.Position = _player.GameObject.Position + new Vector2(-100, 0); GamePadVibrationController.Instance.StartVibration(GameInfo.GamePadMaxIntensity, GameInfo.GamePadMaxIntensity, GameInfo.GamePadVibrationTime); CameraShaker.Instance.StartShake(1, 5); SoundManager.Instance.PlaySound(_explosionSound); SetGameState(GameState.EndAnimations); } }
public void ResetPlayer() { _velocityScaler = 1.0f; _dashCooldown = 0; _dashDuration = 0; _poseDuration = 0; _currentPose = false; _consecutivePoseCount = 0; _playerGameObject.Sprite.UpdateTexture(_playerPose); _playerFallingSpriteSheet.StartSpriteAnimation(); _spriteSheetPosition.X = _playerGameObject.Position.X; _spriteSheetPosition.Y = _playerGameObject.Position.Y - _playerGameObject.Sprite.Height / 2.0f; _playerFallingSpriteSheet.Sprite.Position = _spriteSheetPosition; }