-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1138 from Calinou/truck-town-add-moods
Add moods (times of day) to Truck Town demo
- Loading branch information
Showing
15 changed files
with
289 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[gd_resource type="ProceduralSkyMaterial" format=3 uid="uid://bpms6jemjgt36"] | ||
|
||
[resource] | ||
sky_horizon_color = Color(0.64625, 0.65575, 0.67075, 1) | ||
ground_horizon_color = Color(0.64625, 0.65575, 0.67075, 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[gd_resource type="ProceduralSkyMaterial" format=3 uid="uid://drtvj2ilm4c7h"] | ||
|
||
[resource] | ||
sky_top_color = Color(0.164732, 0.303048, 0.411552, 1) | ||
sky_horizon_color = Color(0.686775, 0.600323, 0.467043, 1) | ||
ground_horizon_color = Color(0.686275, 0.6, 0.466667, 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[gd_resource type="ProceduralSkyMaterial" format=3 uid="uid://c2w5t0j2rkiuu"] | ||
|
||
[resource] | ||
sky_top_color = Color(0.0964875, 0.114707, 0.155705, 1) | ||
sky_horizon_color = Color(0.201247, 0.148966, 0.125881, 1) | ||
ground_horizon_color = Color(0.2, 0.14902, 0.12549, 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[gd_resource type="ProceduralSkyMaterial" format=3 uid="uid://dbs05x6h8miq2"] | ||
|
||
[resource] | ||
sky_top_color = Color(0.252654, 0.288234, 0.368141, 1) | ||
sky_horizon_color = Color(0.77459, 0.550361, 0.50128, 1) | ||
ground_horizon_color = Color(0.776471, 0.54902, 0.501961, 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
extends Node3D | ||
|
||
enum Mood { | ||
SUNRISE, | ||
DAY, | ||
SUNSET, | ||
NIGHT, | ||
MAX, | ||
} | ||
|
||
var mood := Mood.DAY: set = set_mood | ||
|
||
|
||
func _input(event: InputEvent) -> void: | ||
if event.is_action_pressed(&"cycle_mood"): | ||
mood = wrapi(mood + 1, 0, Mood.MAX) as Mood | ||
|
||
|
||
func set_mood(p_mood: Mood) -> void: | ||
mood = p_mood | ||
|
||
match p_mood: | ||
Mood.SUNRISE: | ||
$DirectionalLight3D.rotation_degrees = Vector3(-20, -150, -137) | ||
$DirectionalLight3D.light_color = Color(0.414, 0.377, 0.25) | ||
$DirectionalLight3D.light_energy = 4.0 | ||
$WorldEnvironment.environment.fog_light_color = Color(0.686, 0.6, 0.467) | ||
$WorldEnvironment.environment.sky.sky_material = preload("res://town/sky_morning.tres") | ||
$ArtificialLights.visible = false | ||
Mood.DAY: | ||
$DirectionalLight3D.rotation_degrees = Vector3(-55, -120, -31) | ||
$DirectionalLight3D.light_color = Color.WHITE | ||
$DirectionalLight3D.light_energy = 1.45 | ||
$WorldEnvironment.environment.sky.sky_material = preload("res://town/sky_day.tres") | ||
$WorldEnvironment.environment.fog_light_color = Color(0.62, 0.601, 0.601) | ||
$ArtificialLights.visible = false | ||
Mood.SUNSET: | ||
$DirectionalLight3D.rotation_degrees = Vector3(-19, -31, 62) | ||
$DirectionalLight3D.light_color = Color(0.488, 0.3, 0.1) | ||
$DirectionalLight3D.light_energy = 4.0 | ||
$WorldEnvironment.environment.sky.sky_material = preload("res://town/sky_sunset.tres") | ||
$WorldEnvironment.environment.fog_light_color = Color(0.776, 0.549, 0.502) | ||
$ArtificialLights.visible = true | ||
Mood.NIGHT: | ||
$DirectionalLight3D.rotation_degrees = Vector3(-49, 116, -46) | ||
$DirectionalLight3D.light_color = Color(0.232, 0.415, 0.413) | ||
$DirectionalLight3D.light_energy = 0.7 | ||
$WorldEnvironment.environment.sky.sky_material = preload("res://town/sky_night.tres") | ||
$WorldEnvironment.environment.fog_light_color = Color(0.2, 0.149, 0.125) | ||
$ArtificialLights.visible = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.