Example #1
0
        public GameplayScreen(ScreenManager screenManager)
        {
            ScreenManager = screenManager;

            TransitionOnTime  = TimeSpan.FromSeconds(1.5);
            TransitionOffTime = TimeSpan.FromSeconds(0.5);
            Global.DebugMode  = false;


            SpriteImages = Global.Game.GameContent.DIRManager.SpriteManager.Sprites;
            MapImage     = Global.Game.GameContent.ImageManager.GetImage(ScreenManager.GraphicsDevice, 1);
            Bitmap       = Global.Game.GameContent.ImageManager.Bitmaps[1];

            //MapImage.SaveAsPng(File.Create("map.png"), MapImage.Width, MapImage.Height);
            Map = new Map(MapImage, Bitmap);

            MapState.Init();

            Physics.Init();

            Players = new Player[4];

            for (int i = 0; i < 4; i++)
            {
                Players[i] = new Player(i);
            }

            LevelIndex = 0;

            DebugInfo = "";

            GameState = new GameState();

            GameState.Init(Players);
        }