From 5969b56b7541ed77cd1ed84405ef0b0db41fb9cd Mon Sep 17 00:00:00 2001 From: Ategon Date: Sat, 14 Sep 2024 21:19:19 -0400 Subject: [PATCH] Fix timings --- Main.tscn | 7 ++++++- Night.tscn | 6 ++++++ main.gd | 13 +++++++++++++ parts/globals.txt | 14 +------------- 4 files changed, 26 insertions(+), 14 deletions(-) create mode 100644 Night.tscn diff --git a/Main.tscn b/Main.tscn index 1d55697..1a39630 100644 --- a/Main.tscn +++ b/Main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=17 format=4 uid="uid://5ske2hm55rce"] +[gd_scene load_steps=18 format=4 uid="uid://5ske2hm55rce"] [ext_resource type="PackedScene" uid="uid://n2lpy72tkyc8" path="res://storm/StormManager.tscn" id="1_gcxt1"] [ext_resource type="Script" path="res://main.gd" id="1_pg2kh"] @@ -12,6 +12,7 @@ [ext_resource type="Texture2D" uid="uid://bccyjf2bn3mpj" path="res://background.png" id="7_bnuu0"] [ext_resource type="PackedScene" uid="uid://byyyhq3x8t2d8" path="res://InfoWindow.tscn" id="7_f4xfy"] [ext_resource type="PackedScene" uid="uid://b22pr3istdhcv" path="res://ui/BuildingMenu.tscn" id="7_hnxcf"] +[ext_resource type="PackedScene" path="res://Night.tscn" id="13_8fvl0"] [ext_resource type="AudioStream" uid="uid://dfxndvkdey800" path="res://light version final(1).wav" id="13_tvksj"] [ext_resource type="AudioStream" uid="uid://dk2thkxy31doi" path="res://heavy version.wav" id="14_frsfx"] @@ -180,6 +181,10 @@ pivot_offset = Vector2(114, 128) [node name="BuildingMenu" parent="CanvasLayer" instance=ExtResource("7_hnxcf")] +[node name="Night" parent="CanvasLayer" instance=ExtResource("13_8fvl0")] +modulate = Color(1, 1, 1, 0) +color = Color(0.121569, 0, 0.25098, 0.392157) + [node name="CanvasLayer2" type="CanvasLayer" parent="."] layer = -1 diff --git a/Night.tscn b/Night.tscn new file mode 100644 index 0000000..c503799 --- /dev/null +++ b/Night.tscn @@ -0,0 +1,6 @@ +[gd_scene format=3 uid="uid://v4qfjewow3cb"] + +[node name="Night" type="ColorRect"] +offset_right = 640.0 +offset_bottom = 360.0 +color = Color(0.121569, 0, 0.25098, 0.690196) diff --git a/main.gd b/main.gd index 688af67..6cbb8d2 100644 --- a/main.gd +++ b/main.gd @@ -7,6 +7,19 @@ extends Node2D $Node2D/Level5/BuildingLevel5, $Node2D/BuildingLevel6 ] +@onready var night: ColorRect = $CanvasLayer/Night +var night_tween + +func _ready() -> void: + if night_tween: + night_tween.kill() + + night_tween = create_tween() + night_tween.set_loops() + night_tween.tween_property(night, "modulate", Color.TRANSPARENT, 5) + night_tween.tween_interval(15) + night_tween.tween_property(night, "modulate", Color.WHITE, 5) + func _process(delta: float) -> void: if Input.is_action_just_released("lclick"): diff --git a/parts/globals.txt b/parts/globals.txt index 1488cf1..c677dcb 100644 --- a/parts/globals.txt +++ b/parts/globals.txt @@ -1,20 +1,8 @@ -time_to_flood_change: 250 +time_to_flood_change: 25 flood_levels[] 0 - 2 - 4 - 5 - 3 1 0 - 2 - 4 - 5 - 3 1 - 0 2 - 4 - 5 - 3 1