Package com.csse3200.game.lighting
Class DayNightCycle
java.lang.Object
com.csse3200.game.lighting.DayNightCycle
Handles ambient lighting for the game to produce a day/night cycle effect.
Controls time of day and day length, and can pause and resume the cycle.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
static final com.badlogic.gdx.graphics.Color[]
-
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
DAY_LENGTH
public static final long DAY_LENGTH- See Also:
-
keyTimes
public static final com.badlogic.gdx.graphics.Color[] keyTimes
-
-
Constructor Details
-
DayNightCycle
public DayNightCycle(box2dLight.RayHandler rayHandler)
-
-
Method Details
-
pause
public void pause()Pauses the day/night cycle. -
resume
public void resume()Resumes the day/night cycle. -
getTimeOfDay
public float getTimeOfDay()Returns a float representing the time of day. 0.0 is midnight and 1.0 is the next midnight.- Returns:
- the time of day as a float between 0.0 and 1.0
-
update
public void update()Updates the day/night cycle ambient lighting effect.
-