/// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize( )
        {
            Maps = SimpleUtils.Create2DArray(1, 1, new Map(MAP_SIZE));
            //Maps[0][0].Randomize( );
            PlayerPosition = new Point(12, 7);
            for (uint x = 10; x <= 14; x++)
            {
                Maps[0][0][x, 9] = Map.WALL;
            }
            Cam = new Camera(new Vector2(0, 0), new Vector2(32f, 32f));
            SimpleUtils.Init(GraphicsDevice);

            base.Initialize( );
        }
Exemplo n.º 2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize( )
        {
            Tuple <Map, Point> tuple = WinUtils.LoadMap("Content/asd.lrmap");

            Map    = tuple.Item1;
            Player = new Player(tuple.Item2);
            Player.SetHero(GraphicsDevice, 1 / 260f);
            Cam = new Camera(new Vector2(0, 0), new Vector2(32f, 32f));
            SimpleUtils.Init(GraphicsDevice);
            // TODO: Renders will be used for more fust drawing of the background... Later
            Renders = new RenderTarget2D[4];
            for (uint i = 0; i < Renders.Length; i++)
            {
                Renders[i] = new RenderTarget2D(GraphicsDevice, Graphics.PreferredBackBufferWidth, Graphics.PreferredBackBufferHeight);
            }

            base.Initialize();
        }