Singleton
Extends: Node
Name | Type | Default |
---|---|---|
IN_GAME_SECONDS_PER_REAL_TIME_SECONDS | int |
5400 |
Name | Type | Default |
---|---|---|
game_start_hour | int |
12 |
game_start_day | int |
1 |
game_start_month | int |
1 |
game_start_year | int |
2021 |
state_dawn_start_hour | int |
5 |
state_day_start_hour | int |
8 |
state_dusk_start_hour | int |
16 |
state_night_start_hour | int |
19 |
state_transition_seconds | int |
3600 |
freeze_time | bool |
true |
Name | Type | Default |
---|---|---|
set_current_hour | int |
- |
seconds_to_minutes | float |
- |
seconds_to_hours | float |
- |
seconds_to_days | float |
- |
seconds_to_months | float |
- |
seconds_to_years | float |
- |
minutes_to_seconds | float |
- |
minutes_to_hours | float |
- |
hours_to_seconds | float |
- |
hours_to_days | float |
- |
days_to_months | float |
- |
months_to_years | float |
- |
const IN_GAME_SECONDS_PER_REAL_TIME_SECONDS: int = 5400
The amount of in-game seconds that should elapse for each real-time second.
It has to be at least 60
so that seconds_elapsed
can be stored as an int
.
90 minutes (5400 seconds) in game == 1 second in real time.
Name | Type | Default |
---|---|---|
IN_GAME_SECONDS_PER_REAL_TIME_SECONDS |
int |
5400 |
var game_start_hour: int = 12
The hour of the day at which the game starts (0-23).
Name | Type | Default |
---|---|---|
game_start_hour |
int |
12 |
var game_start_day: int = 1
The day of the month at which the game starts (1-30).
Name | Type | Default |
---|---|---|
game_start_day |
int |
1 |
var game_start_month: int = 1
The month at which the game starts (1-12).
Name | Type | Default |
---|---|---|
game_start_month |
int |
1 |
var game_start_year: int = 2021
The year at which the game starts (0-INF).
Name | Type | Default |
---|---|---|
game_start_year |
int |
2021 |
var state_dawn_start_hour: int = 5
The starting hour of the dawn cycle state (0-23).
Name | Type | Default |
---|---|---|
state_dawn_start_hour |
int |
5 |
var state_day_start_hour: int = 8
The starting hour of the day cycle state (0-23).
Name | Type | Default |
---|---|---|
state_day_start_hour |
int |
8 |
var state_dusk_start_hour: int = 16
The starting hour of the dusk cycle state (0-23).
Name | Type | Default |
---|---|---|
state_dusk_start_hour |
int |
16 |
var state_night_start_hour: int = 19
The starting hour of the night cycle state (0-23).
Name | Type | Default |
---|---|---|
state_night_start_hour |
int |
19 |
var state_transition_seconds: int = 3600
The duration, in in-game seconds, of the time it takes to transition from one state to another.
Name | Type | Default |
---|---|---|
state_transition_seconds |
int |
3600 |
var freeze_time: bool = true setget _set_freeze_time
Stops the time.
Name | Type | Default | Setter |
---|---|---|---|
freeze_time |
bool |
true |
_set_freeze_time |
func get_current_second() -> int
Returns the current second.
Returns: int
func get_current_minute() -> int
Returns the current minute.
Returns: int
func get_current_hour() -> int
Returns the current hour.
Returns: int
func get_current_day() -> int
Returns the current day.
Returns: int
func get_current_month() -> int
Returns the current month.
Returns: int
func get_current_year() -> int
Returns the current year.
Returns: int
func set_current_hour(hour: int)
Sets the current hour.
Name | Type | Default |
---|---|---|
hour |
int |
- |
func current_time_string() -> String
Returns the current time in H:M:S
.
Returns: String
func current_date_string() -> String
Returns the current date in D/M/Y
.
Returns: String
func current_cycle_to_string() -> String
Returns the current cycle state in a String
format.
Returns: String
func seconds_to_minutes(seconds: float) -> float
Converts seconds into minutes.
Returns: float
Name | Type | Default |
---|---|---|
seconds |
float |
- |
func seconds_to_hours(seconds: float) -> float
Converts seconds into hours.
Returns: float
Name | Type | Default |
---|---|---|
seconds |
float |
- |
func seconds_to_days(seconds: float) -> float
Converts seconds into days.
Returns: float
Name | Type | Default |
---|---|---|
seconds |
float |
- |
func seconds_to_months(seconds: float) -> float
Converts seconds into months.
Returns: float
Name | Type | Default |
---|---|---|
seconds |
float |
- |
func seconds_to_years(seconds: float) -> float
Converts seconds into years.
Returns: float
Name | Type | Default |
---|---|---|
seconds |
float |
- |
func minutes_to_seconds(minutes: float) -> float
Converts minutes into seconds.
Returns: float
Name | Type | Default |
---|---|---|
minutes |
float |
- |
func minutes_to_hours(minutes: float) -> float
Converts minutes into hours.
Returns: float
Name | Type | Default |
---|---|---|
minutes |
float |
- |
func hours_to_seconds(hours: float) -> float
Converts hours into seconds.
Returns: float
Name | Type | Default |
---|---|---|
hours |
float |
- |
func hours_to_days(hours: float) -> float
Converts hours into days.
Returns: float
Name | Type | Default |
---|---|---|
hours |
float |
- |
func days_to_months(days: float) -> float
Converts days into months.
Returns: float
Name | Type | Default |
---|---|---|
days |
float |
- |
func months_to_years(months: float) -> float
Converts months into years.
Returns: float
Name | Type | Default |
---|---|---|
months |
float |
- |
Powered by GDScriptify.