Fixing strange blacking out of shadows issue
Deploy Promiscuity Auth API / deploy (push) Successful in 49s
Deploy Promiscuity Character API / deploy (push) Successful in 47s
Deploy Promiscuity Crafting API / deploy (push) Successful in 48s
Deploy Promiscuity Inventory API / deploy (push) Successful in 48s
Deploy Promiscuity Locations API / deploy (push) Successful in 49s
Deploy Promiscuity Mail API / deploy (push) Successful in 48s
Deploy Promiscuity World API / deploy (push) Successful in 46s
k8s smoke test / test (push) Successful in 9s
Deploy Promiscuity Auth API / deploy (push) Successful in 49s
Deploy Promiscuity Character API / deploy (push) Successful in 47s
Deploy Promiscuity Crafting API / deploy (push) Successful in 48s
Deploy Promiscuity Inventory API / deploy (push) Successful in 48s
Deploy Promiscuity Locations API / deploy (push) Successful in 49s
Deploy Promiscuity Mail API / deploy (push) Successful in 48s
Deploy Promiscuity World API / deploy (push) Successful in 46s
k8s smoke test / test (push) Successful in 9s
This commit is contained in:
+16
-14
@@ -1,7 +1,7 @@
|
||||
extends Node3D
|
||||
|
||||
@export var day_length := 120.0 # seconds for full rotation
|
||||
@export var start_light_angle := -90.0
|
||||
@export var day_length := 120.0 # seconds for full rotation
|
||||
@export var start_light_angle := -35.0
|
||||
@export var show_spawn_dialog := true
|
||||
@export_multiline var spawn_dialog_text := "Welcome to Promiscuity.\n\nPress E to close this message."
|
||||
@export var spawn_dialog_auto_close_seconds := 4.0
|
||||
@@ -35,6 +35,7 @@ const FIRST_QUEST := {
|
||||
}
|
||||
|
||||
func _ready() -> void:
|
||||
_apply_sun_state(0.0)
|
||||
_setup_quests()
|
||||
if _should_show_spawn_dialog() and DialogSystem and DialogSystem.has_method("show_text"):
|
||||
await get_tree().process_frame
|
||||
@@ -46,18 +47,19 @@ func _ready() -> void:
|
||||
DialogSystem.close_if_text(spawn_dialog_text)
|
||||
_show_quest_intro_dialog()
|
||||
|
||||
func _process(delta):
|
||||
time = fmod((time + delta), day_length)
|
||||
var t = time / day_length
|
||||
|
||||
# Rotate sun around X axis
|
||||
var angle = lerp(start_light_angle, end_light_angle, t) # sunrise → sunset → night → sunrise
|
||||
sun.rotation_degrees.x = angle
|
||||
|
||||
# Adjust intensity
|
||||
var curSin = -sin((t * TAU) + start_radians)
|
||||
var energy = clamp((curSin * 1.0) + 0.2, 0.0, 1.2)
|
||||
sun.light_energy = energy
|
||||
func _process(delta):
|
||||
time = fmod((time + delta), day_length)
|
||||
_apply_sun_state(time / day_length)
|
||||
|
||||
|
||||
func _apply_sun_state(t: float) -> void:
|
||||
# Start in a clear daytime state instead of at the horizon, which created
|
||||
# long harsh shadows as soon as the level loaded.
|
||||
var angle = lerp(start_light_angle, end_light_angle, t)
|
||||
sun.rotation_degrees.x = angle
|
||||
var cur_sin = -sin((t * TAU) + start_radians)
|
||||
var energy = clamp((cur_sin * 1.0) + 0.2, 0.0, 1.2)
|
||||
sun.light_energy = energy
|
||||
|
||||
|
||||
func _setup_quests() -> void:
|
||||
|
||||
Reference in New Issue
Block a user