Exemplo n.º 1
0
        public void LoadTheStuffs(int levelIndex)
        {
            mainViewport = gameStateManager.game.GraphicsDevice.Viewport;
            player1Viewport = mainViewport;
            player2Viewport = mainViewport;

            if (GameStateManager.isMultiplayer)
            {
                player1Viewport.Width = player1Viewport.Width / 2;
                player2Viewport.Width = player2Viewport.Width / 2;
                player1Viewport.X = 0;
                player2Viewport.X = player1Viewport.Width;

                verticalDivide = new SpriteIMG(LoadTexture("blackLine"), new Vector2(mainViewport.Width / 2, mainViewport.Height / 2));
                verticalDivide.scale = new Vector2(1, 32);
            }

            alphaDot = new SpriteIMG(LoadTexture("ShaderAssets/playerAlphaMask"));
            alphaDot.scale = new Vector2(2);

            switch (levelIndex)
            {
                case 0:
                    level = new TestLevel(this);
                    break;
                case 1:
                    level = new Level1(this);
                    break;
                case 2:
                    level = new Level2(this);
                    break;
                case 3:
                    level = new Level3(this);
                    break;
                case 4:
                    level = new Level4(this);
                    break;
                case 5:
                    level = new Level5(this);
                    break;
                case 6:
                    level = new Level6(this);
                    break;
                case 7:
                    level = new Level7(this);
                    break;
                case 50:
                    level = new theBridge(this);
                    break;
                case 99:
                    level = new FinalBridge(this);
                    break;
                default:
                    level = new TestLevel(this);
                    break;
            }

            alphaMask = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            renderTarget = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            player1Objects = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            player2Objects = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            player1Backgrounds = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            player2Backgrounds = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            alphaPlayer = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            nonAlphaPlayer = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            finalTarget = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            alphaBGPlayer = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            nonAlphaBGPlayer = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);

            //alphaMask2 = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            //renderTarget2 = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            //player1Objects2 = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            //player2Objects2 = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            //alphaPlayer2 = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            //nonAlphaPlayer2 = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            //finalTarget2 = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            //lightMask2 = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            //bgTarget2 = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            multiFinalTarget1 = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            multiFinalTarget2 = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            alphaShader = LoadEffect("ShaderAssets/AlphaMapping");
            lightingShader = LoadEffect("ShaderAssets/Lighting");
            colorShader = LoadEffect("ShaderAssets/ColorTransform");
            glowShader = LoadEffect("ShaderAssets/StrokeGlow");
            warpShader = LoadEffect("ShaderAssets/Warp");
            lightMask = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            auraTarget = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            auraTargetOrigin = new Vector2(Game1.screenWidth / 2, Game1.screenHeight / 2);
            player2Aura = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            bgTarget = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            bgTarget1 = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            bgTarget2 = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            lightningTarget = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            warpTarget = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);
            warpTarget2 = new RenderTarget2D(gameStateManager.game.GraphicsDevice, Game1.screenWidth, Game1.screenHeight);

            gaussianBlur = new GaussianBlur(gameStateManager.game);
            gaussianBlur.ComputeKernel(BLUR_RADIUS, BLUR_AMOUNT);

            int renderTargetWidth = Game1.screenWidth;
            int renderTargetHeight = Game1.screenHeight;

            blurX = new RenderTarget2D(gameStateManager.game.GraphicsDevice,
                renderTargetWidth, renderTargetHeight, false,
                gameStateManager.game.GraphicsDevice.PresentationParameters.BackBufferFormat,
                DepthFormat.None);
            blurY = new RenderTarget2D(gameStateManager.game.GraphicsDevice,
                renderTargetWidth, renderTargetHeight, false,
                gameStateManager.game.GraphicsDevice.PresentationParameters.BackBufferFormat,
                DepthFormat.None);
            blurX2 = new RenderTarget2D(gameStateManager.game.GraphicsDevice,
                renderTargetWidth, renderTargetHeight, false,
                gameStateManager.game.GraphicsDevice.PresentationParameters.BackBufferFormat,
                DepthFormat.None);
            blurY2 = new RenderTarget2D(gameStateManager.game.GraphicsDevice,
                renderTargetWidth, renderTargetHeight, false,
                gameStateManager.game.GraphicsDevice.PresentationParameters.BackBufferFormat,
                DepthFormat.None);

            gaussianBlur.ComputeOffsets(renderTargetWidth, renderTargetHeight);
            //okayToDraw = false;
            gameStateManager.game.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, null, null, null, colorShader);
            player1.Draw(gameStateManager.game.spriteBatch);
            gameStateManager.game.spriteBatch.End();
            gaussianBlur.PerformGaussianBlur(player1.texture, blurX, blurY, gameStateManager.game.spriteBatch);
            //okayToDraw = true;
            isLoading = false;

            player1.indicatorTexture = LoadTexture("player1Ideal");
            player2.indicatorTexture = LoadTexture("player2Ideal");

            List<IdealAnimationSet> player1Textures = new List<IdealAnimationSet>();
            player1.idleSet = new IdealAnimationSet(player1.regularTexture, player1.indicatorTexture, 1, 1, 8, 8, 6, 8);
            player1Textures.Add(player1.idleSet);
            player1.runningLeadSet = new IdealAnimationSet(player1.regularTexture, player1.indicatorTexture, 1, 8, 8, 8, 1, 5, new Point(1,8));
            player1Textures.Add(player1.runningLeadSet);
            player1.runningSet = new IdealAnimationSet(player1.regularTexture, player1.indicatorTexture, 2, 1, 8, 8, 8 ,8);
            player1Textures.Add(player1.runningSet);
            player1.runningEndSet = new IdealAnimationSet(player1.regularTexture, player1.indicatorTexture, 1, 8, 8, 8, 1, 5, new Point(1,8));
            player1Textures.Add(player1.runningEndSet);
            player1.jumpingUpLeadSet = new IdealAnimationSet(player1.regularTexture, player1.indicatorTexture, 5, 1, 8, 8, 2,5, new Point(5,1));
            player1Textures.Add(player1.jumpingUpLeadSet);
            player1.jumpingUpSet = new IdealAnimationSet(player1.regularTexture, player1.indicatorTexture, 5, 2, 8, 8, 4,8);
            player1Textures.Add(player1.jumpingUpSet);
            player1.jumpingDownLeadSet = new IdealAnimationSet(player1.regularTexture, player1.indicatorTexture, 5, 6, 8, 8, 4,5, new Point(5,6));
            player1Textures.Add(player1.jumpingDownLeadSet);
            player1.jumpingDownSet = new IdealAnimationSet(player1.regularTexture, player1.indicatorTexture, 5, 7, 8, 8, 4,8);
            player1Textures.Add(player1.jumpingDownSet);
            player1.jumpingDownEndSet = new IdealAnimationSet(player1.regularTexture, player1.indicatorTexture, 6, 3, 8, 8, 1,5, new Point(6,3));
            player1Textures.Add(player1.jumpingDownEndSet);
            player1.DyingSet = new IdealAnimationSet(player1.regularTexture, player1.indicatorTexture, 3, 1, 8, 8, 8,5, new Point(3,8));
            player1Textures.Add(player1.DyingSet);
            player1.RevivingSet = new IdealAnimationSet(player1.regularTexture, player1.indicatorTexture, 4, 1, 8, 8, 5,8, new Point(4,5));
            player1Textures.Add(player1.RevivingSet);

            List<IdealAnimationSet> player2Textures = new List<IdealAnimationSet>();
            player2.idleSet = new IdealAnimationSet(player2.regularTexture, player2.indicatorTexture, 1, 1, 8, 8, 6, 8);
            player2Textures.Add(player2.idleSet);
            player2.runningLeadSet = new IdealAnimationSet(player2.regularTexture, player2.indicatorTexture, 1, 8, 8, 8, 1, 5, new Point(1, 8));
            player2Textures.Add(player2.runningLeadSet);
            player2.runningSet = new IdealAnimationSet(player2.regularTexture, player2.indicatorTexture, 2, 1, 8, 8, 8, 8);
            player2Textures.Add(player2.runningSet);
            player2.runningEndSet = new IdealAnimationSet(player2.regularTexture, player2.indicatorTexture, 1, 8, 8, 8, 1, 5, new Point(1, 8));
            player2Textures.Add(player2.runningEndSet);
            player2.jumpingUpLeadSet = new IdealAnimationSet(player2.regularTexture, player2.indicatorTexture, 5, 1, 8, 8, 2, 5, new Point(5, 1));
            player2Textures.Add(player2.jumpingUpLeadSet);
            player2.jumpingUpSet = new IdealAnimationSet(player2.regularTexture, player2.indicatorTexture, 5, 2, 8, 8, 4, 8);
            player2Textures.Add(player2.jumpingUpSet);
            player2.jumpingDownLeadSet = new IdealAnimationSet(player2.regularTexture, player2.indicatorTexture, 5, 6, 8, 8, 4, 5, new Point(5, 6));
            player2Textures.Add(player2.jumpingDownLeadSet);
            player2.jumpingDownSet = new IdealAnimationSet(player2.regularTexture, player2.indicatorTexture, 5, 7, 8, 8, 4, 8);
            player2Textures.Add(player2.jumpingDownSet);
            player2.jumpingDownEndSet = new IdealAnimationSet(player2.regularTexture, player2.indicatorTexture, 6, 3, 8, 8, 1, 5, new Point(6, 3));
            player2Textures.Add(player2.jumpingDownEndSet);
            player2.DyingSet = new IdealAnimationSet(player2.regularTexture, player2.indicatorTexture, 3, 1, 8, 8, 8, 5, new Point(3, 8));
            player2Textures.Add(player2.DyingSet);
            player2.RevivingSet = new IdealAnimationSet(player2.regularTexture, player2.indicatorTexture, 4, 1, 8, 8, 5, 8, new Point(4, 5));
            player2Textures.Add(player2.RevivingSet);

            player1.showingRegular = true;
            player2.showingRegular = true;

            signalTexture = LoadTexture("signal");

            //if (gameStateManager.goodness < 0)
            //{
            //    RenderTarget2D indicatorTarget = new RenderTarget2D(GraphicsDevice, player1.texture.Width, player1.texture.Height);
            //    GraphicsDevice.SetRenderTarget(indicatorTarget);
            //    GraphicsDevice.Clear(Color.Transparent);
            //    colorShader.Parameters["DestColor"].SetValue(Color.Black.ToVector4());
            //    gameStateManager.game.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, null, null, null, colorShader);
            //    gameStateManager.game.spriteBatch.Draw(player1.indicatorTexture, Vector2.Zero, Color.White);
            //    gameStateManager.game.spriteBatch.End();
            //    player1.indicatorTexture = indicatorTarget;

            //    RenderTarget2D indicatorTarget2 = new RenderTarget2D(GraphicsDevice, player2.texture.Width, player2.texture.Height);
            //    GraphicsDevice.SetRenderTarget(indicatorTarget2);
            //    GraphicsDevice.Clear(Color.Transparent);
            //    colorShader.Parameters["DestColor"].SetValue(Color.Black.ToVector4());
            //    gameStateManager.game.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, null, null, null, colorShader);
            //    gameStateManager.game.spriteBatch.Draw(player2.indicatorTexture, Vector2.Zero, Color.White);
            //    gameStateManager.game.spriteBatch.End();
            //    player2.indicatorTexture = indicatorTarget2;
            //}

            if (gameStateManager.goodness < -5) gameStateManager.goodness = -5;

            switch (gameStateManager.goodness)
            {
                case -1:
                    player1.indicatorAlpha = 204;
                    player2.indicatorAlpha = 204;
                    break;
                case -2:
                    player1.indicatorAlpha = 153;
                    player2.indicatorAlpha = 153;
                    break;
                case -3:
                    player1.indicatorAlpha = 102;
                    player2.indicatorAlpha = 102;
                    break;
                case -4:
                    player1.indicatorAlpha = 51;
                    player2.indicatorAlpha = 51;
                    break;
                case -5:
                    player1.indicatorAlpha = 0;
                    player2.indicatorAlpha = 0;
                    break;
                case -6:
                    player1.indicatorAlpha = 38;
                    player2.indicatorAlpha = 38;
                    break;
                case -7:
                    player1.indicatorAlpha = 0;
                    player2.indicatorAlpha = 0;
                    break;
                default:
                    player1.indicatorAlpha = 255;
                    player2.indicatorAlpha = 255;
                    break;
            }

            //RenderIdealTextures(player1Textures, player1.indicatorAlpha);

            //RenderIdealTextures(player2Textures, player2.indicatorAlpha);
        }
Exemplo n.º 2
0
 public EventTrigger(Level level, LightningChain lightningChain)
 {
     this.eventLightning = lightningChain;
 }
Exemplo n.º 3
0
 public EventTrigger(Level level, EventObject eventObj)
     : this(level)
 {
     eventObjList.Add(eventObj);
 }
Exemplo n.º 4
0
 public EventTrigger(Level level, int eventID)
     : this(level)
 {
     this.eventID = eventID;
 }
Exemplo n.º 5
0
 public EventTrigger(Level level)
 {
     this.level = level;
 }