예제 #1
0
        private void CreateOtherSceneItems()
        {
            _unhinderedTimeToImpact = GameInfo.TotalGameTime;
            _hinderedPlayerTimer    = GameInfo.TotalGameTime;

            _timeToGameOver = GameInfo.EndGameTime;

            _endExplosion = new SpriteSheetAnimationManager();
            _endExplosion.Initialize(_contentManager, AssetManager.EndExplosionBase,
                                     AssetManager.EndExplosionTotalCount, 1, false, false);
            _endExplosion.Sprite.SetOriginCenter();
            _endExplosion.Sprite.Position =
                new Vector2(GameInfo.FixedWindowWidth / 2.0f, GameInfo.FixedWindowHeight + 300);

            _confetti1 = new SpriteSheetAnimationManager();
            _confetti1.Initialize(_contentManager, AssetManager.ConfettiBase_1,
                                  AssetManager.ConfettiTotalCount_1, 1, false, false);
            _confetti1.Sprite.SetOriginCenter();
            _confetti1.Sprite.Position =
                new Vector2(GameInfo.FixedWindowWidth / 4.0f, GameInfo.FixedWindowHeight + 300);
            _confetti1.FrameTime = AssetManager.ConfettiAnimationSpeed_1;

            _confetti2 = new SpriteSheetAnimationManager();
            _confetti2.Initialize(_contentManager, AssetManager.ConfettiBase_2,
                                  AssetManager.ConfettiTotalCount_2, 1, false, false);
            _confetti2.Sprite.SetOriginCenter();
            _confetti2.Sprite.Position =
                new Vector2(GameInfo.FixedWindowWidth / 4.0f * 3.0f, GameInfo.FixedWindowHeight + 300);
            _confetti2.FrameTime = AssetManager.ConfettiAnimationSpeed_2;
        }
예제 #2
0
        private void CreatePlayerAndBackground()
        {
            _player = new Player();
            _player.Initialize(_contentManager);

            _playerCollisionTimerRate = GameInfo.PlayerTimerChangeRate;

            Texture2D backgroundTexture   = _contentManager.Load <Texture2D>(AssetManager.GameBG);
            Texture2D wrestlingBackground = _contentManager.Load <Texture2D>(AssetManager.WrestingBackground);

            _backgroundSprite = new Sprite(backgroundTexture, true);
            _backgroundSprite.SetOriginCenter();
            _backgroundSprite.SetSize(GameInfo.FixedWindowWidth, GameInfo.FixedWindowHeight);
            _backgroundSprite.Position =
                new Vector2(GameInfo.FixedWindowWidth / 2.0f, GameInfo.FixedWindowHeight / 2.0f);

            _backgroundAudience = new ScrollingBackground();
            _backgroundAudience.Initialize(wrestlingBackground, GameInfo.MaxBackgroundElements,
                                           new Vector2(GameInfo.FixedWindowWidth / 2.0f, GameInfo.FixedWindowHeight), 1, true);
            _backgroundAudience.SetSize(GameInfo.FixedWindowWidth, GameInfo.FixedWindowHeight);

            Texture2D scrollingBackgroundTexture = _contentManager.Load <Texture2D>(AssetManager.BackgroundRopes);

            _scrollingBackground = new ScrollingBackground();
            _scrollingBackground.Initialize(scrollingBackgroundTexture, GameInfo.MaxBackgroundElements,
                                            new Vector2(GameInfo.FixedWindowWidth / 2.0f, GameInfo.FixedWindowHeight), 0.5f);

            Texture2D stage       = _contentManager.Load <Texture2D>(AssetManager.Stage);
            Sprite    stageSprite = new Sprite(stage)
            {
                Scale = GameInfo.StageScale
            };

            stageSprite.SetOriginCenter();
            _stage = new GameObject(stageSprite, stageSprite.Width, stageSprite.Height)
            {
                Position = new Vector2(GameInfo.FixedWindowWidth / 2.0f, GameInfo.FixedWindowHeight + 300)
            };

            Texture2D winWrestler = _contentManager.Load <Texture2D>(AssetManager.WinWrestler);
            Sprite    winSprite   = new Sprite(winWrestler)
            {
                Scale = GameInfo.WrestlerScale
            };

            winSprite.SetOriginCenter();
            _winWrestler = new GameObject(winSprite, winSprite.Width, winSprite.Height)
            {
                Position = new Vector2(GameInfo.FixedWindowWidth / 2.0f, GameInfo.FixedWindowHeight + 250)
            };

            _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.Sprite.Width - 50, 70);
        }
예제 #3
0
        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
            };
        }
예제 #4
0
        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();
        }