Exemplo n.º 1
0
        /// <summary>
        /// Calls Draw() for each MapSquare that is in Viewport
        /// </summary>
        /// <param name="sb"></param>
        static public void Draw(SpriteBatch sb)
        {
            //sb.Draw(bgRect, leftBGRectDrawRect, Color.DarkGray);
            //sb.Draw(tempHUD, leftBGRectDrawRect, Color.White);
            //sb.Draw(bgRect, rightBGRectDrawRect, tileRect, Color.Black, 0f, Vector2.Zero, SpriteEffects.None, 1f);

            for (int row = 0; row < currMap.heightTiles; row++)
            {
                for (int column = 0; column < currMap.widthTiles; column++)
                {
                    if (CheckVisibility(ref currMap.MSGrid[row][column].WorldRect))
                    {
                        if (currMap.MSGrid[row][column].MSStates[(int)MSFlagIndex.BL_ST] == MSFlag.BL)
                        {
                            if (MapEngine.ShowBlankStates == true)
                            {
                                currMap.MSGrid[row][column].BaseColor = Color.Aqua;
                            }

                            currMap.MSGrid[row][column].Draw(ref sb, blankBG, shadowMasks, mDrawOrg, mEngVportWLoc);
                        }
                        else
                        {
                            currMap.MSGrid[row][column].Draw(ref sb, curMTex2D[currMap.MSGrid[row][column].MapTexIndex], shadowMasks, mDrawOrg, mEngVportWLoc);
                        }
                    }
                }
            }

            InfoWriter.Draw(sb);
        }
Exemplo n.º 2
0
        static public void LoadMap()//ref string file_name)
        {
            string testStr = "test.xml";

            MapLoader.SavedMapToMap(ref testStr, out currMap);

            maxMEngVportBounds.X = currMap.widthTiles * Globals.tileSize;
            maxMEngVportBounds.Y = currMap.heightTiles * Globals.tileSize;
            mEngVportWLoc        = Vector2.Zero;

            SetMapEngineViewportDimensions(880, 880);

            LoadMapTextures();

            InfoWriter.ReInitialize();
        }
Exemplo n.º 3
0
        private void LoadContent(ref ContentManager contentMan)
        {
            normalmapEffect = ScreenManager.contentMan.Load <Effect>("normalmap");

            MapEngine.LoadContent(ScreenManager.contentMan);
            InfoWriter.LoadContent();

            MapEngine.NewMap();
            MapEngine.LoadMap();
            mapLoaded = true;

            curPlayer = new Player(ref ScreenManager.contentMan, "test_hero", MapEngine.currMap.startPoint, Directions.S,
                                   CharacterLoader.LoadCharacter(ref ScreenManager.contentMan, "test_hero", "Player"));
            curPlayer.MapSprite.texture         = ScreenManager.contentMan.Load <Texture2D>(curPlayer.MapSprite.textureName);
            curPlayer.MapSprite.FrameDimensions = new Point(55, 55);
            curPlayer.MapSprite.ResetAnimation();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Private constructor of a Session object.
        /// </summary>
        /// <remarks>
        /// The lack of public constructors forces the singleton model.
        /// </remarks>
        private GameSession()//ScreenManager screenManager, TempGamePlayScreen gameplayScreen)
        {
            MapEngine.Initialize(ScreenManager.graphicDevMan);
            InfoWriter.Initialize();

            // check the parameter
            //if (screenManager == null)
            //{
            //    throw new ArgumentNullException("screenManager");
            //}
            //if (gameplayScreen == null)
            //{
            //    throw new ArgumentNullException("gameplayScreen");
            //}

            // assign the parameter
            //this.screenManager = screenManager;
            //this.gameplayScreen = gameplayScreen;

            // create the HUD interface
            //this.hud = new Hud(screenManager);
            //this.hud.LoadContent();
        }