Exemple #1
0
        protected override void Initialize()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            camera = new Camera();

            DrawingUtils.Initialize(spriteBatch, camera);

#if !DEBUG
            DrawingUtils.DrawingRectangle = false;
#endif

            bool generateRandomly = false;
            GenerateMap(generateRandomly);
            town = new Town(generateRandomly);
            //string path = "test.xml";

            GodMode.ShowCommands();

            //TileMap.SaveToXML(path);
            //TileMap.LoadFromXML(path);
            TextureManager.Initialize();



            base.Initialize();
        }
Exemple #2
0
        protected override void Update(GameTime gameTime)
        {
            InputHelper.Update(camera);

            GodMode.Update(gameTime, camera, town);
            UpdateCameraMovement();
            //UpdateObjectMovement(gameTime);

            TileMap.Update(gameTime);
            town.Update(gameTime);

            base.Update(gameTime);
        }
Exemple #3
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            spriteBatch.Begin(
                SpriteSortMode.BackToFront,
                BlendState.NonPremultiplied,
                null,
                null,
                null,
                null,
                camera.TransformMatrix);

            TileMap.Draw(spriteBatch, camera);
            town.Draw(spriteBatch);
            GodMode.Draw();

            spriteBatch.End();

            base.Draw(gameTime);
        }