Ejemplo n.º 1
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            DebugTextures.LoadTextures(GraphicsDevice);

            Text.defaultFont = Content.Load <SpriteFont>("fonts\\npc1");
            Text.guiFont     = Content.Load <SpriteFont>("fonts\\gui");

            Cell.CreateGrid(new Point(-3200, -3200), 500, 500);

            Dialogue.InitializeDialogueSystem(graphics.GraphicsDevice.Viewport);

            map = new Map();

            screenCenter = new Vector2(gameWidth / 2f, gameHeight / 2f);

            character = new Character();

            map.npcs.Add(new NPC(new Vector2(100, -100), DebugTextures.GenerateRectangle(16, 32, Color.Yellow), "Hello world!!", "Great to see you decided to play this game!!"));
            map.npcs.Add(new NPC(new Vector2(150, 10), DebugTextures.GenerateRectangle(16, 32, Color.Yellow), "Hello, my name is tommy! I used to live in peace", "watering me plants in me garden everyday, until the unpredictable struck"));
            map.enemies.Add(new PeasantSoldier(50f, 0.005f, 200f, 300f, 100, screenCenter, DebugTextures.GenerateRectangle(16, 16, Color.DarkGray), character));
            map.enemies.Add(new PeasantSoldier(86, 0.004f, 200f, 300f, 100, new Vector2(53, 3466), DebugTextures.GenerateRectangle(16, 16, Color.GreenYellow), character));
            map.enemies.Add(new PeasantSoldier(70f, 0.004f, 200f, 300f, 100, new Vector2(62, 23), DebugTextures.GenerateRectangle(16, 16, Color.DarkRed), character));
            map.enemies.Add(new PeasantSoldier(69f, 0.004f, 200f, 300f, 100, new Vector2(97, 2), DebugTextures.GenerateRectangle(16, 16, Color.Red), character));
            map.enemies.Add(new PeasantSoldier(82f, 0.004f, 200f, 300f, 100, new Vector2(64, 0), DebugTextures.GenerateRectangle(16, 16, Color.Yellow), character));
            map.enemies.Add(new PeasantSoldier(56f, 0.004f, 200f, 300f, 100, new Vector2(2, 49), DebugTextures.GenerateRectangle(16, 16, Color.Blue), character));

            Vector2 pos = Cell.SnapToGrid(Vector2.One * 40);

            map.objects.Add(new Wall(pos, 64, 64, true));

            Raycast.RayCastTest();
        }