private bool _useAsDummy; // This is a very hacky method that handles Custom Player Hiding and Collision Boxes #region Initialization public void Initialize(ContentManager contentManager) { _playerPose = contentManager.Load <Texture2D>(AssetManager.Player); Sprite playerSprite = new Sprite(_playerPose) { Scale = GameInfo.PlayerAssetScale, }; playerSprite.SetOriginCenter(); _pose1 = contentManager.Load <Texture2D>(AssetManager.Pose1); _pose2 = contentManager.Load <Texture2D>(AssetManager.Pose2); _playerFallingSpriteSheet = new SpriteSheetAnimationManager(); _playerFallingSpriteSheet.Initialize(contentManager, AssetManager.FireFallingBase, AssetManager.FireFallingTotalCount, 1, true); _playerFallingSpriteSheet.FrameTime = 0.01666667F; _playerFallingSpriteSheet.RenderOnStopped = false; _playerFallingSpriteSheet.Sprite.SetOriginCenter(); _spriteSheetPosition = Vector2.Zero; _playerGameObject = new GameObject(playerSprite, _playerPose.Width * GameInfo.PlayerAssetScale, _playerPose.Height * GameInfo.PlayerAssetScale) { Acceleration = GameInfo.BaseAccelerationRate, Position = GameInfo.PlayerInitialPosition, }; _playerController = new PlayerController(); _velocityScaler = 1.0f; _dashCooldown = 0; _dashDuration = 0; _poseDuration = 0; _consecutivePoseCount = 0; _boostDuration = 0; _playerColorFlasher = new ColorFlashSwitcher() { StartFlash = false, StartColor = Color.White * 1, EndColor = Color.White * 0, FlashCount = GameInfo.PlayerFlashCount, LerpRate = GameInfo.PlayerFlashRate, ResetAutomatically = true }; }
public override void Initialize(ContentManager contentManager) { _contentManager = contentManager; Texture2D stageTexture = _contentManager.Load <Texture2D>(AssetManager.Stage); Texture2D playerTexture = _contentManager.Load <Texture2D>(AssetManager.PlayerFlipped); Texture2D scrollerRope = _contentManager.Load <Texture2D>(AssetManager.BackgroundRopes); Texture2D winWrestler = _contentManager.Load <Texture2D>(AssetManager.WinWrestler); Texture2D backgroundTexture = _contentManager.Load <Texture2D>(AssetManager.GameBG); Texture2D wrestlingBackground = _contentManager.Load <Texture2D>(AssetManager.WrestingBackground); _stage = new Sprite(stageTexture) { Scale = GameInfo.StageScale }; _stage.SetOriginCenter(); _playerSprite = new Sprite(playerTexture) { Scale = GameInfo.PlayerAssetScale }; _playerSprite.SetOriginCenter(); _playerFlasher = new ColorFlashSwitcher() { StartFlash = false, StartColor = Color.White * 1, EndColor = Color.White * 0, FlashCount = GameInfo.PlayerFlashCount, LerpRate = GameInfo.PlayerFlashRate, ResetAutomatically = true }; _backgroundSprite = new Sprite(backgroundTexture, true); _backgroundSprite.SetOriginCenter(); _backgroundSprite.SetSize(GameInfo.FixedWindowWidth, GameInfo.FixedWindowHeight); _audienceScrolling = new ScrollingBackground(); _audienceScrolling.Initialize(wrestlingBackground, GameInfo.MaxBackgroundElements, new Vector2(GameInfo.FixedWindowWidth / 2.0f, GameInfo.FixedWindowHeight), 1, true); _audienceScrolling.SetSize(GameInfo.FixedWindowWidth, GameInfo.FixedWindowHeight); _cinematicBackgroundScroller = new CinematicBackgroundScroller(); _cinematicBackgroundScroller.Initialize(scrollerRope, 0.5f, GameInfo.TotalCinematicRopes, GameInfo.CinematicStageInitialPosition, GameInfo.CinematicRowFinalPosition); _winWrestler = new Sprite(winWrestler) { Scale = GameInfo.WrestlerScale }; _winWrestler.SetOriginCenter(); _starSpriteSheetAnimationManager = new SpriteSheetAnimationManager(); _starSpriteSheetAnimationManager.Initialize(_contentManager, AssetManager.StarBase, AssetManager.StarTotalCount, 0, true); _starSpriteSheetAnimationManager.FrameTime = AssetManager.StarAnimationSpeed; _starSprite = _starSpriteSheetAnimationManager.Sprite; _starSprite.Scale = 0.4f; _starsOffset = new Vector2(_winWrestler.Width - 50, 70); _dummyPlayer = new Player(); _dummyPlayer.Initialize(_contentManager); _dummyPlayer.OnPlayerHitNotification += HandlePlayerHit; CreateAudiences(); CreateSounds(); }