示例#1
0
        public void Draw(SpriteBatch spriteBatch)
        {
            camera.BeginDraw(spriteBatch);
            background.Draw(spriteBatch);
            spriteBatch.End();

            LightPolygon.BeginDraw();

            foreach (Light light in lights)
            {
                light.Draw();
            }

            LightPolygon.EndDraw(spriteBatch);

            camera.BeginDraw(spriteBatch);

            player.Draw(spriteBatch);

            foreach (IObstacle obstacle in obstacles)
            {
                obstacle.Draw(spriteBatch);
            }

            spriteBatch.End();
        }
示例#2
0
        public static void Initialize(GraphicsDevice GraphicsDevice, ContentManager Content)
        {
            camera = new Camera();

            LightPolygonUnused.Initialize(GraphicsDevice, camera);
            LightPolygon.Initialize(GraphicsDevice, camera);
            EdgelessPolygon.Initialize(GraphicsDevice, camera);
            Image.Initialize(Content);
        }
示例#3
0
        public Light(Vector2 position, float mainAngle, float maxAngleDiff, float strength, Color color)
        {
            this.position = position;

            this.mainAngle = mainAngle;

            this.maxAngleDiff = maxAngleDiff;
            castObjects       = new List <IShadowCastingObject>();
            polygon           = new LightPolygon(strength, color);
        }
示例#4
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            graphics.PreferredBackBufferWidth  = C.screenWidth;
            graphics.PreferredBackBufferHeight = C.screenHeight;
            graphics.IsFullScreen = true;

            LightPolygon.EarlyInitialize(graphics);
        }
示例#5
0
 public static void Initialize(GraphicsDevice GraphicsDevice, Camera camera)
 {
     LightPolygon.Initialize(GraphicsDevice, camera);
 }
示例#6
0
 public static void EarlyInitialize(GraphicsDeviceManager graphics)
 {
     LightPolygon.EarlyInitialize(graphics);
 }
示例#7
0
 public static void EndDraw(SpriteBatch spriteBatch)
 {
     LightPolygon.EndDraw(spriteBatch);
 }
示例#8
0
 public static void BeginDraw()
 {
     LightPolygon.BeginDraw();
 }