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(); }
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); }
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); }
public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; graphics.PreferredBackBufferWidth = C.screenWidth; graphics.PreferredBackBufferHeight = C.screenHeight; graphics.IsFullScreen = true; LightPolygon.EarlyInitialize(graphics); }
public static void Initialize(GraphicsDevice GraphicsDevice, Camera camera) { LightPolygon.Initialize(GraphicsDevice, camera); }
public static void EarlyInitialize(GraphicsDeviceManager graphics) { LightPolygon.EarlyInitialize(graphics); }
public static void EndDraw(SpriteBatch spriteBatch) { LightPolygon.EndDraw(spriteBatch); }
public static void BeginDraw() { LightPolygon.BeginDraw(); }