Ejemplo n.º 1
0
    public void Draw(AD2SpriteBatch sb)
    {
        Renderer.GraphicsDevice.Clear(Color.White);

        //figure out camera stuff
        int cameraX = 0;
        int cameraY = 0;

        foreach (PC p in allPlayers())
        {
            cameraX += p.X - (CastleSpire.BaseWidth / 2);
            cameraY += p.Y - (CastleSpire.BaseHeight / 2);
        }

        cameraX /= allPlayers().Count;
        cameraY /= allPlayers().Count;

        //no soul lighitng
        // l.center_x = p.x + player.size/2;
        //l.center_y = player.y + player.size/2;

        DrawWorldNoLighting(sb, cameraX, cameraY);
        Lightmap.RenderLightMap(sb, AmbientLight.AmbientColor(Clock), cameraX, cameraY, CastleSpire.BaseWidth, CastleSpire.BaseHeight);


        /*** LIGHTING STUFF
         * /**
         * //Before dawn, draw a lightsource at the player spot. That way he/she can see a little bit.
         * if (clock.hours() < AmbientLight.hourDawn || clock.hours() >= AmbientLight.hourDusk)
         * {
         *    soul = new Light(soulcol, player.x + (player.size / 2), player.y + (player.size / 2), 7, 40);
         *    lights.AddFirst(soul);
         * }
         * if (clock.hours() == AmbientLight.hourDawn && (clock.minutes() < 20))
         * {
         *    soul = new Light(Utils.mix(20 * 60,(60 * clock.minutes()) + clock.seconds(),soulcol, AmbientLight.ambientColor(clock)), player.x + (player.size / 2), player.y + (player.size / 2), 7,40);
         *    lights.AddFirst(soul);
         * }
         * if (clock.hours() == AmbientLight.hourSunset && (clock.minutes() > 40))
         * {
         *   soul = new Light(Utils.mix(20 * 60, (60 * (clock.minutes() - 40 ) ) + clock.seconds(), AmbientLight.ambientColor(clock), soulcol) , player.x + (player.size / 2), player.y + (player.size / 2), 7, 40);
         *   lights.AddFirst(soul);
         * }
         * //Nancies();
         */
        for (int i = 0; i != 4; i++)
        {
            if (HUDs[i] != null)
            {
                HUDs[i].Draw(sb);
            }
        }

        ClockHUD.Draw(sb, Clock);
    }