public SlopedPlatform(ContentManager cm, GraphicsDeviceManager gdm, SpriteBatch sb, ImageLibrary il, Vector2 startSlopePos, Vector2 endSlopePos, int platBodyHeight, float lDepth, bool slidable, bool cOnLeftSide, bool cOnRightSide, bool cOnBottom)
        {
            cmReference  = cm;
            gdmReference = gdm;
            imageLibrary = il;
            sbReference  = sb;

            platformSlope = new Line(startSlopePos, endSlopePos);
            slopeTexture  = il.smwOutsideGrass;
            //platformSlope = new Line(new Vector2(0, 1000), new Vector2(200, 800));

            if (platformSlope.pt1.Y < platformSlope.pt2.Y)
            {
                boundingPlatform = new Platform(cmReference, sbReference, gdmReference, imageLibrary, new Vector2(((platformSlope.pt2.Y - platformSlope.pt1.Y) / 16), (platformSlope.getBoundingRectangle.Height / 16)), new Vector2(platformSlope.getBoundingRectangle.Left, platformSlope.getBoundingRectangle.Top), slidable, true, true, false, false, true);
            }
            else
            {
                boundingPlatform = new Platform(cmReference, sbReference, gdmReference, imageLibrary, new Vector2(((platformSlope.pt1.Y - platformSlope.pt2.Y) / 16), (platformSlope.getBoundingRectangle.Height / 16)), new Vector2(platformSlope.getBoundingRectangle.Left, platformSlope.getBoundingRectangle.Top), slidable, true, false, true, false, true);
            }

            layerDepth = lDepth;

            platformBodyHeight = platBodyHeight * 16;

            collidableOnLeftSide  = cOnLeftSide;
            collidableOnRightSide = cOnRightSide;
            collidableOnBottom    = cOnBottom;
        }
 protected override void LoadContent()
 {
     spriteBatch = new SpriteBatch(GraphicsDevice);
     tScreen     = new TestScreen(Content, graphics, spriteBatch, Color.Orange);
     //RegalFalls = new RegalFalls(Content, graphics, spriteBatch, Color.CornflowerBlue);
     screenManager.addScreen(new SplashScreen(Content, graphics, spriteBatch));
     mainImageLibrary = new ImageLibrary(Content, spriteBatch, graphics);
 }
示例#3
0
        //-----------------------------------------------------

        public CharacterSelectScreen(ContentManager cManager, GraphicsDeviceManager gdmReference, SpriteBatch sbReference, ImageLibrary iLibrary, GameMode gMode)
            : base(cManager, gdmReference, sbReference)
        {
            gameFont     = cManager.Load <SpriteFont>("Fonts/PlaceholderFont");
            imageLibrary = iLibrary;

            playerOne   = null;
            playerTwo   = null;
            playerThree = null;
            playerFour  = null;

            gameMode = gMode;
            if (gameMode == GameMode.SinglePlayer)
            {
                maxPlayersAllowed = 1;
            }
            else if (gameMode == GameMode.CoopPlayOnline || gameMode == GameMode.CoopPlayOffline)
            {
                maxPlayersAllowed = 2;
            }
            else if (gameMode == GameMode.CompetitivePlayOnline || gameMode == GameMode.CompetitivePlayOffline)
            {
                maxPlayersAllowed = 4;
            }

            //players joined tracker, and the boolean that lets us know when it's time to go back
            currentPlayersJoined = 0;
            goBackToTitleScreen  = false;

            //delay time
            selectionDelayTimer = 0;
            selectionDelayMax   = 15;

            redTile    = imageLibrary.basicRedTile;
            orangeTile = imageLibrary.basicOrangeTile;
            yellowTile = imageLibrary.basicYellowTile;
            greenTile  = imageLibrary.basicGreenTile;

            //sets the expected rectangle that's supposed to represent the underlay
            characterOneUnderlay   = new Rectangle(0, 200, 560, 192);
            characterTwoUnderlay   = new Rectangle(gdmReference.GraphicsDevice.Viewport.Width - 560, 200, 560, 192);
            characterThreeUnderlay = new Rectangle(0, 450, 560, 192);
            characterFourUnderlay  = new Rectangle(gdmReference.GraphicsDevice.Viewport.Width - 560, 450, 560, 192);

            //will be deprecated but will be initialized as such
            playerTwoSelector   = new CharacterSelector(cmReference, gdmReference, sbReference, imageLibrary, new Vector2(characterTwoUnderlay.X, characterTwoUnderlay.Y), 1, 0);
            playerThreeSelector = new CharacterSelector(cmReference, gdmReference, sbReference, imageLibrary, new Vector2(characterThreeUnderlay.X, characterThreeUnderlay.Y), 0, 1);
            playerFourSelector  = new CharacterSelector(cmReference, gdmReference, sbReference, imageLibrary, new Vector2(characterFourUnderlay.X, characterFourUnderlay.Y), 1, 1);
        }
示例#4
0
        //----------------------------------------------------------------------------------------------------------------------------------------------------------
        public Platform(ContentManager cm, SpriteBatch sb, GraphicsDeviceManager gdm, ImageLibrary il, Vector2 platSize, Vector2 pos, bool slidableOnL, bool slidableOnR, bool cOnLeft, bool cOnRight, bool cOnTop, bool cOnBottom)
        {
            //sets the references to the spritebatch and content manager so this class can define items in the content pipeline and draw to the same area
            imageLibrary = il;
            sbReference  = sb;
            cmReference  = cm;
            gdmReference = gdm;

            /*
             * topLeftImage = il.topLeftGrassPlatform;
             * topImage = il.topGrassPlatform;
             * topRightImage = il.topRightGrassPlatform;
             *
             * leftImage = il.leftGrassPlatform;
             * centerImage = il.centerGrassPlatform;
             * rightImage = il.rightGrassPlatform;
             *
             * bottomLeftImage = il.bottomLeftGrassPlatform;
             * bottomImage = il.bottomGrassPlatform;
             * bottomRightImage = il.bottomRightGrassPlatform;
             */
            completeOutsidePlatformImage             = il.smwOutsideGrass;
            completeOutsidePlatformImage.isAnimating = false;

            movingLeft  = false;
            movingRight = false;
            movingUp    = false;
            movingDown  = false;

            collidableOnLeft   = cOnLeft;
            collidableOnRight  = cOnRight;
            collidableOnTop    = cOnTop;
            collidableOnBottom = cOnBottom;

            canSlideOnLeft  = slidableOnL;
            canSlideOnRight = slidableOnR;

            //equivilant of the player class is the boolean "standing", basically default state
            notMoving = true;

            platformSize = platSize;
            position     = pos;

            layerDepth = .70f;
        }
示例#5
0
        public Spring(ContentManager cm, GraphicsDeviceManager gdm, SpriteBatch sb, ImageLibrary il, Vector2 worldPos, Vector2 momentumToImpart, float springRotation)
        {
            cmReference  = cm;
            gdmReference = gdm;
            sbReference  = sb;

            //probably going to have to have each spring load its own separate texture because this will make it do weird drawing for multiple springs
            imageSheet = new AnimatedImage(cm, sb, gdm.GraphicsDevice, "GameObjects/Springs/SonicSpring", new Vector2(190, 38), new Vector2(5, 1));
            imageSheet.setFrameConfiguration(0, 0, 3);
            imageSheet.frameTimeLimit = 1;
            imageSheet.isAnimating    = false;

            layerDepth = .5f;
            rotation   = springRotation;

            worldPosition    = worldPos;
            momentumImparted = momentumToImpart;
        }
        public Ladder(ContentManager cm, GraphicsDeviceManager gdm, SpriteBatch sb, ImageLibrary il, Vector2 worldPos, Vector2 ladderWidthHeight)
        {
            cmReference  = cm;
            gdmReference = gdm;
            sbReference  = sb;

            ladderLeft  = il.TestLadderLeft;
            ladderRight = il.TestLadderRight;
            ladderRung  = il.TestLadderRung;

            layerDepth = .55f;

            worldPosition = worldPos;

            width  = (int)ladderWidthHeight.X;
            height = (int)ladderWidthHeight.Y;

            ladderTop = new Platform(cm, sb, gdm, il, new Vector2(width / 16, 1), new Vector2(worldPosition.X, worldPosition.Y), true, true, false, false, true, false);
        }
        public GrindRail(ContentManager cm, GraphicsDeviceManager gdm, SpriteBatch sb, ImageLibrary il, Vector2 startSlopePos, Vector2 endSlopePos, int platBodyHeight, float lDepth)
        {
            cmReference  = cm;
            gdmReference = gdm;
            imageLibrary = il;
            sbReference  = sb;

            platformSlope = new Line(startSlopePos, endSlopePos);
            slopeTexture  = il.testRail;
            //platformSlope = new Line(new Vector2(0, 1000), new Vector2(200, 800));

            if (platformSlope.pt1.Y < platformSlope.pt2.Y)
            {
                boundingPlatform = new Platform(cmReference, sbReference, gdmReference, imageLibrary, new Vector2(((platformSlope.pt2.Y - platformSlope.pt1.Y) / 16), (platformSlope.getBoundingRectangle.Height / 16)), new Vector2(platformSlope.getBoundingRectangle.Left, platformSlope.getBoundingRectangle.Top), true, true, true, false, false, true);
            }
            else
            {
                boundingPlatform = new Platform(cmReference, sbReference, gdmReference, imageLibrary, new Vector2(((platformSlope.pt1.Y - platformSlope.pt2.Y) / 16), (platformSlope.getBoundingRectangle.Height / 16)), new Vector2(platformSlope.getBoundingRectangle.Left, platformSlope.getBoundingRectangle.Top), true, true, false, true, false, true);
            }

            layerDepth = lDepth;

            platformBodyHeight = platBodyHeight * 16;
        }
        //----------------------------------------------------------------------------------------------------------------------------------------------------------
        public DisappearingPlatform(ContentManager cm, SpriteBatch sb, GraphicsDeviceManager gdm, ImageLibrary il, Vector2 platSize, Vector2 pos, bool slidableOnL, bool slidableOnR, bool cOnLeft, bool cOnRight, bool cOnTop, bool cOnBottom)
            : base(cm, sb, gdm, il, platSize, pos, slidableOnL, slidableOnR, cOnLeft, cOnRight, cOnTop, cOnBottom)
        {
            isVanishing     = false;
            vanishDirection = VanishDirection.rightToLeft;

            vanishTimer    = 0;
            vanishTimerMax = 0;
        }
示例#9
0
 //----------------------------------------------------------------------------------------------------------------------------------------------------------
 public GoalPlatform(ContentManager cm, SpriteBatch sb, GraphicsDeviceManager gdm, ImageLibrary il, Vector2 platSize, Vector2 pos, bool slidableOnL, bool slidableOnR, bool cOnLeft, bool cOnRight, bool cOnTop, bool cOnBottom)
     : base(cm, sb, gdm, il, platSize, pos, slidableOnL, slidableOnR, cOnLeft, cOnRight, cOnTop, cOnBottom)
 {
     completeOutsidePlatformImage = il.goalTile;
 }
        public RegalFallsDeprecatedOne(ContentManager cm, GraphicsDeviceManager gdm, SpriteBatch sb, ImageLibrary iLibrary, Player pOne) : base(cm, gdm, sb)
        {
            cmReference  = cm;
            gdmReference = gdm;
            sbReference  = sb;

            imageLibrary = iLibrary;

            parallaxBackgrounds = new List <ParallaxBackground>();

            platforms         = new List <Platform>();
            platformsToRemove = new List <Platform>();

            slopedPlatforms = new List <SlopedPlatform>();

            springs = new List <Spring>();

            worldTreasure         = new List <Treasure>();
            worldTreasureToRemove = new List <Treasure>();

            //System.Diagnostics.Debug.WriteLine(testPlatform.platformSlope.getSlope());

            //configures default map
            map = new TileMap(cm, gdm, sb, new Vector2(500, 400), new Vector2(16, 16));
            //----------------------------------------------------------Start Map Configuration----------------------------------------
            int tileTrackerX = 0;
            int tileTrackerY = 0;

            //iterates through row by column and initializes based on some arbitrary distinctions
            while (tileTrackerY < map.tileMapHeight)
            {
                while (tileTrackerX < map.tileMapWidth)
                {
                    /*
                     * if (tileTrackerX > map.tileMapWidth / 2)
                     * {
                     *  //bottom right
                     *  if (tileTrackerY > map.tileMapHeight / 2)
                     *  {
                     *      map.tiles[tileTrackerX, tileTrackerY] = new BackgroundTile(cm, gdm, sb, new Vector2(map.tilePositionX, map.tilePositionY), new Vector2(16, 16), new Vector2(1, 1), imageLibrary.basicGreenTile, false, false, false, false);
                     *  }
                     *  //bottom left
                     *  else
                     *  {
                     *      map.tiles[tileTrackerX, tileTrackerY] = new BackgroundTile(cm, gdm, sb, new Vector2(map.tilePositionX, map.tilePositionY), new Vector2(16, 16), new Vector2(1, 1), imageLibrary.basicOrangeTile, false, false, false, false);
                     *  }
                     * }
                     * //top
                     * else
                     * {
                     *  //top right
                     *  if (tileTrackerY > map.tileMapHeight / 2)
                     *  {
                     *      map.tiles[tileTrackerX, tileTrackerY] = new BackgroundTile(cm, gdm, sb, new Vector2(map.tilePositionX, map.tilePositionY), new Vector2(16, 16), new Vector2(1, 1), imageLibrary.basicYellowTile , false, false, false, false);
                     *  }
                     *  //top left
                     *  else
                     *  {
                     *      map.tiles[tileTrackerX, tileTrackerY] = new BackgroundTile(cm, gdm, sb, new Vector2(map.tilePositionX, map.tilePositionY), new Vector2(16, 16), new Vector2(1, 1), imageLibrary.basicRedTile, false, false, false, false);
                     *  }
                     * }
                     */
                    map.tiles[tileTrackerX, tileTrackerY] = new BackgroundTile(cm, gdm, sb, new Vector2(map.tilePositionX, map.tilePositionY), new Vector2(16, 16), new Vector2(1, 1), imageLibrary.basicBlueTile, false, false, false, false);
                    map.tilePositionX += map.defaultTileWidth;
                    tileTrackerX++;
                }
                map.tilePositionX  = 0;
                tileTrackerX       = 0;
                map.tilePositionY += map.defaultTileHeight;
                tileTrackerY++;
            }
            //----------------------------------------------------------End Map Configuration----------------------------------------
            playerOneCamera = new Camera(cmReference, gdmReference, sbReference, new Vector2(0, 0), gdmReference.GraphicsDevice.Viewport.TitleSafeArea.Width, gdmReference.GraphicsDevice.Viewport.TitleSafeArea.Height);
            //playerTwoCamera = new Camera(cm, gdm, sb, new Vector2(0, 0), graphicsDeviceManagerReference.GraphicsDevice.Viewport.TitleSafeArea.Width / 2, graphicsDeviceManagerReference.GraphicsDevice.Viewport.TitleSafeArea.Height);
            //playerTwoCamera.screenPosition = new Vector2(graphicsDeviceManagerReference.GraphicsDevice.Viewport.TitleSafeArea.Width / 2, 0);

            playerOne = pOne;
            playerOne.previousWorldPosition = new Vector2(0, 0);
            playerOne.currentWorldPosition  = new Vector2(0, 0);

            //playerTwo = new playerOne(cm, sb, gdm);
            //playerTwo.currentWorldPosition = playerTwoCamera.worldPosition;

            //Configures the lists
            configureParallaxBackgrounds();
            configureWorldPlatforms();
            configureWorldSlopePlatforms();
            configureWorldSprings();
            configureWorldTreasure();

            hurdleOne = new Hurdle(cmReference, gdmReference, sbReference, (new Vector2(4288, 1280 - hurdleOne.height)));

            hurdleTwo = new Hurdle(cmReference, gdmReference, sbReference, (new Vector2(map.getTileMapWidthInPixels / 2 - 400, map.getTileMapHeightInPixels - hurdleTwo.height)));

            testRope = new SwingRope(cmReference, gdmReference, sbReference, new Vector2(2304, 896), 200);

            testLadder = new Ladder(cmReference, gdmReference, sbReference, imageLibrary, new Vector2(2944 - playerOne.width, 1280), new Vector2(playerOne.width, 500));

            gravity = new Vector2(0, 9);
        }
        public RegalFallsOne(ContentManager cm, GraphicsDeviceManager gdm, SpriteBatch sb, ImageLibrary iLibrary, Player pOne)
            : base(cm, gdm, sb)
        {
            nextLevel = NextLevelPointer.WorldOneLevelTwo;

            cmReference  = cm;
            gdmReference = gdm;
            sbReference  = sb;

            imageLibrary = iLibrary;

            parallaxBackgrounds = new List <ParallaxBackground>();

            platforms         = new List <Platform>();
            platformsToRemove = new List <Platform>();

            slopedPlatforms = new List <SlopedPlatform>();

            grindRails = new List <GrindRail>();
            tightRopes = new List <TightRope>();

            springs   = new List <Spring>();
            ladders   = new List <Ladder>();
            hurdles   = new List <Hurdle>();
            bearTraps = new List <BearTrap>();

            worldTreasure         = new List <Treasure>();
            worldTreasureToRemove = new List <Treasure>();

            endOfLevelTrigger = new EventTrigger();

            //System.Diagnostics.Debug.WriteLine(testPlatform.platformSlope.getSlope());

            //configures default map
            map = new LevelMap(cm, gdm, sb, new Vector2(344, 264), new Vector2(16, 16));
            //----------------------------------------------------------Start Map Configuration----------------------------------------
            int tileTrackerX = 0;
            int tileTrackerY = 0;

            //iterates through row by column and initializes based on some arbitrary distinctions
            while (tileTrackerY < map.tileMapHeight)
            {
                while (tileTrackerX < map.tileMapWidth)
                {
                    map.tiles[tileTrackerX, tileTrackerY] = new BackgroundTile(cm, gdm, sb, new Vector2(map.tilePositionX, map.tilePositionY), new Vector2(16, 16), new Vector2(1, 1), imageLibrary.basicBlueTile, false, false, false, false);
                    map.tilePositionX += map.defaultTileWidth;
                    tileTrackerX++;
                }
                map.tilePositionX  = 0;
                tileTrackerX       = 0;
                map.tilePositionY += map.defaultTileHeight;
                tileTrackerY++;
            }
            //----------------------------------------------------------End Map Configuration----------------------------------------
            playerOneCamera = new Camera(cmReference, gdmReference, sbReference, new Vector2(0, 0), gdmReference.GraphicsDevice.Viewport.TitleSafeArea.Width, gdmReference.GraphicsDevice.Viewport.TitleSafeArea.Height);
            //playerTwoCamera = new Camera(cm, gdm, sb, new Vector2(0, 0), graphicsDeviceManagerReference.GraphicsDevice.Viewport.TitleSafeArea.Width / 2, graphicsDeviceManagerReference.GraphicsDevice.Viewport.TitleSafeArea.Height);
            //playerTwoCamera.screenPosition = new Vector2(graphicsDeviceManagerReference.GraphicsDevice.Viewport.TitleSafeArea.Width / 2, 0);

            playerOne = pOne;
            playerOne.previousWorldPosition = new Vector2(0, 0);
            playerOne.currentWorldPosition  = new Vector2(0, 0);

            //playerTwo = new playerOne(cm, sb, gdm);
            //playerTwo.currentWorldPosition = playerTwoCamera.worldPosition;

            //Configures the lists
            configureParallaxBackgrounds();
            configureWorldPlatforms();
            configureWorldSlopePlatforms();
            configureWorldGrindRails();
            configureWorldTightRopes();
            configureWorldSprings();
            configureWorldLadders();
            configureWorldHurdles();
            configureWorldBearTraps();
            configureWorldTreasure();

            gravity = new Vector2(0, 9);

            scoreFont = cmReference.Load <SpriteFont>("Fonts/PlaceholderFont");

            deathWatchTimer           = 0;
            deathWatchTimerTimerLimit = 60;
        }
示例#12
0
        //----------------------------------------------------------------------------------------------------------------------------------------------------------
        public MovingPlatform(ContentManager cm, SpriteBatch sb, GraphicsDeviceManager gdm, ImageLibrary il, Vector2 platSize, Vector2 startPos, Vector2 endPos, Vector2 moveSpeed, bool slidableOnL, bool slidableOnR, bool cOnLeft, bool cOnRight, bool cOnTop, bool cOnBottom)
            : base(cm, sb, gdm, il, platSize, startPos, slidableOnL, slidableOnR, cOnLeft, cOnRight, cOnTop, cOnBottom)
        {
            completeOutsidePlatformImage = il.smwOutsideGrass;

            startPosition = startPos;
            endPosition   = endPos;
            movementSpeed = moveSpeed;
            movingRight   = true;
            movingDown    = true;
        }
示例#13
0
        public ResistantWaterPlatform(ContentManager cm, SpriteBatch sb, GraphicsDeviceManager gdm, ImageLibrary il, Vector2 platSize, Vector2 pos, float resist, bool slidableOnL, bool slidableOnR, bool cOnLeft, bool cOnRight, bool cOnTop, bool cOnBottom)
            : base(cm, sb, gdm, il, platSize, pos, slidableOnL, slidableOnR, cOnLeft, cOnRight, cOnTop, cOnBottom)
        {
            topWater.imageSheet = il.resisitantWaterCrestTile.imageSheet;

            //moves playerOne to the left
            if (resist < 0)
            {
                flipTopWaterCrest = true;
            }
            else
            {
                flipTopWaterCrest = false;
            }

            resistance = resist;
        }
        //----------------------------------------------------------------------------------------------------------------------------------------------------------
        public WaterPlatform(ContentManager cm, SpriteBatch sb, GraphicsDeviceManager gdm, ImageLibrary il, Vector2 platSize, Vector2 pos, bool slidableOnL, bool slidableOnR, bool cOnLeft, bool cOnRight, bool cOnTop, bool cOnBottom)
            : base(cm, sb, gdm, il, platSize, pos, slidableOnL, slidableOnR, cOnLeft, cOnRight, cOnTop, cOnBottom)
        {
            topWater = il.waterCrestTile;
            topWater.setFrameConfiguration(0, 0, 1);
            topWater.frameTimeLimit = 15;

            completeOutsidePlatformImage = il.waterBodyTile;

            layerDepth = .25f;

            flipTopWaterCrest = false;
        }
        public ContainerPlatform(ContentManager cm, SpriteBatch sb, GraphicsDeviceManager gdm, ImageLibrary il, Vector2 platSize, Vector2 pos, bool slidableOnL, bool slidableOnR, bool cOnLeft, bool cOnRight, bool cOnTop, bool cOnBottom)
            : base(cm, sb, gdm, il, platSize, pos, slidableOnL, slidableOnR, cOnLeft, cOnRight, cOnTop, cOnBottom)
        {
            //Outside image
            completeOutsidePlatformImage = il.smwOutsideGrass;
            completeInsideImage          = il.completeInsideGrassPlatform;

            playerIsContained = true;
        }
示例#16
0
        public CharacterSelector(ContentManager cm, GraphicsDeviceManager gdm, SpriteBatch sb, ImageLibrary iLibrary, Vector2 worldPos, int hovHorSelection, int hovVerSelection)
        {
            cmReference  = cm;
            gdmReference = gdm;
            sbReference  = sb;

            hoverHorizontalSelection = hovHorSelection;
            hoverVerticalSelection   = hovVerSelection;

            horizontalSelectionMax = 1;
            verticalSelectionMax   = 1;

            selectorImage = iLibrary.characterSelector;

            worldPosition = worldPos;

            selectorLocked      = false;
            selectionDelayTimer = 0;
            selectionDelayMax   = 15;
        }
        public TylerLevel(ContentManager cm, GraphicsDeviceManager gdm, SpriteBatch sb, ImageLibrary iLibrary, Player pOne) : base(cm, gdm, sb)
        {
            cmReference  = cm;
            gdmReference = gdm;
            sbReference  = sb;

            imageLibrary = iLibrary;

            parallaxBackgrounds = new List <ParallaxBackground>();

            platforms         = new List <Platform>();
            platformsToRemove = new List <Platform>();

            slopedPlatforms = new List <SlopedPlatform>();

            grindRails = new List <GrindRail>();

            springs = new List <Spring>();

            worldTreasure         = new List <Treasure>();
            worldTreasureToRemove = new List <Treasure>();

            //System.Diagnostics.Debug.WriteLine(testPlatform.platformSlope.getSlope());

            //configures default map
            map = new LevelMap(cm, gdm, sb, new Vector2(168, 260), new Vector2(16, 16));
            //----------------------------------------------------------Start Map Configuration----------------------------------------
            int tileTrackerX = 0;
            int tileTrackerY = 0;

            //iterates through row by column and initializes based on some arbitrary distinctions
            while (tileTrackerY < map.tileMapHeight)
            {
                while (tileTrackerX < map.tileMapWidth)
                {
                    map.tiles[tileTrackerX, tileTrackerY] = new BackgroundTile(cm, gdm, sb, new Vector2(map.tilePositionX, map.tilePositionY), new Vector2(16, 16), new Vector2(1, 1), imageLibrary.basicBlueTile, false, false, false, false);
                    map.tilePositionX += map.defaultTileWidth;
                    tileTrackerX++;
                }
                map.tilePositionX  = 0;
                tileTrackerX       = 0;
                map.tilePositionY += map.defaultTileHeight;
                tileTrackerY++;
            }
            //----------------------------------------------------------End Map Configuration----------------------------------------
            playerOneCamera = new Camera(cmReference, gdmReference, sbReference, new Vector2(0, 0), gdmReference.GraphicsDevice.Viewport.TitleSafeArea.Width, gdmReference.GraphicsDevice.Viewport.TitleSafeArea.Height);
            //playerTwoCamera = new Camera(cm, gdm, sb, new Vector2(0, 0), graphicsDeviceManagerReference.GraphicsDevice.Viewport.TitleSafeArea.Width / 2, graphicsDeviceManagerReference.GraphicsDevice.Viewport.TitleSafeArea.Height);
            //playerTwoCamera.screenPosition = new Vector2(graphicsDeviceManagerReference.GraphicsDevice.Viewport.TitleSafeArea.Width / 2, 0);

            playerOne = pOne;
            playerOne.previousWorldPosition = new Vector2(0, 0);
            playerOne.currentWorldPosition  = new Vector2(0, 0);

            //playerTwo = new playerOne(cm, sb, gdm);
            //playerTwo.currentWorldPosition = playerTwoCamera.worldPosition;

            //Configures the lists
            configureParallaxBackgrounds();
            configureWorldPlatforms();
            configureWorldSlopePlatforms();
            configureWorldGrindRails();
            configureWorldSprings();
            configureWorldTreasure();

            gravity = new Vector2(0, 9);
        }
示例#18
0
        public SpikedPlatform(ContentManager cm, SpriteBatch sb, GraphicsDeviceManager gdm, ImageLibrary il, Vector2 platSize, Vector2 pos, bool slidableOnL, bool slidableOnR, bool spOnLeft, bool spOnRight, bool spOnTop, bool spOnBottom, bool cOnLeft, bool cOnRight, bool cOnTop, bool cOnBottom)
            : base(cm, sb, gdm, il, platSize, pos, slidableOnL, slidableOnR, cOnLeft, cOnRight, cOnTop, cOnBottom)
        {
            spikedOnLeft   = spOnLeft;
            spikedOnRight  = spOnRight;
            spikedOnTop    = spOnTop;
            spikedOnBottom = spOnBottom;

            completeOutsidePlatformImage = il.smwOutsideGrass;
            spikedPlatformImage          = il.spikePlatform;
        }
示例#19
0
 public GreenJewel(ContentManager cm, GraphicsDeviceManager gdm, SpriteBatch sb, ImageLibrary il, Vector2 startCenterPos, float treasureRotation)
     : base(cm, gdm, sb, il, startCenterPos, treasureRotation)
 {
     imageSheet = il.greenJewelImage;
 }
示例#20
0
        public Treasure(ContentManager cm, GraphicsDeviceManager gdm, SpriteBatch sb, ImageLibrary il, Vector2 startCenterPos, float treasureRotation)
        {
            cmReference  = cm;
            gdmReference = gdm;
            sbReference  = sb;

            //probably going to have to have each spring load its own separate texture because this will make it do weird drawing for multiple springs
            imageSheet = il.goldJewelImage;
            imageSheet.setFrameConfiguration(0, 0, 4);
            imageSheet.isAnimating = false;

            layerDepth = .5f;
            rotation   = treasureRotation;

            centerPosition      = startCenterPos;
            startCenterPosition = startCenterPos;

            animatingUp   = false;
            animatingDown = true;

            floatIncrementTimer    = 0;
            floatIncrementTimerMax = 3;
        }