summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrique Alves <henrique.alves@itsjungle.xyz>2024-01-27 19:56:46 +0200
committerHenrique Alves <henrique.alves@itsjungle.xyz>2024-01-27 19:56:46 +0200
commit9c2895c0015180b8bb43b8f9173af3f790f890df (patch)
tree287b71e03fc9a8e27a0c4a173b3a68e6342930b3
parent550d81ba3e3da2fd7bf15adb16b3484a032f8ff4 (diff)
downloadgamejam-ggj-2024-9c2895c0015180b8bb43b8f9173af3f790f890df.tar.gz
gamejam-ggj-2024-9c2895c0015180b8bb43b8f9173af3f790f890df.tar.bz2
gamejam-ggj-2024-9c2895c0015180b8bb43b8f9173af3f790f890df.zip
fix fucking fuck
-rw-r--r--game/main.gd12
-rw-r--r--game/main.tscn54
-rw-r--r--game/shared/scripts/microgame.gd1
-rw-r--r--game/transition/transition.tscn12
4 files changed, 67 insertions, 12 deletions
diff --git a/game/main.gd b/game/main.gd
index 3195392..68f2d3c 100644
--- a/game/main.gd
+++ b/game/main.gd
@@ -14,6 +14,11 @@ var _microgame_count = 1
func _ready() -> void:
+ %FadeAnimationPlayer.play("fade_in")
+ transition.reset()
+ transition.microgame_fade_out()
+ await %FadeAnimationPlayer.animation_finished
+
remove_child(microgame_viewport)
transition.microgame_viewport_container.add_child(microgame_viewport)
microgame_viewport.offset_bottom = 0
@@ -21,12 +26,8 @@ func _ready() -> void:
microgame_viewport.offset_right = 0
microgame_viewport.offset_top = 0
- transition.reset()
-
while true:
if _current_microgame != null:
- _current_microgame.process_mode = Node.PROCESS_MODE_DISABLED
-
await transition.microgame_fade_out()
_current_microgame.queue_free()
@@ -43,6 +44,9 @@ func _ready() -> void:
_current_microgame.process_mode = Node.PROCESS_MODE_INHERIT
_won_last_microgame = await _current_microgame.finished
+ _current_microgame.process_mode = Node.PROCESS_MODE_DISABLED
+
+ await get_tree().create_timer(1.0).timeout
_starting = false
_microgame_count += 1
diff --git a/game/main.tscn b/game/main.tscn
index 055f1d2..29f0699 100644
--- a/game/main.tscn
+++ b/game/main.tscn
@@ -1,8 +1,44 @@
-[gd_scene load_steps=3 format=3 uid="uid://culqaacu08vye"]
+[gd_scene load_steps=6 format=3 uid="uid://culqaacu08vye"]
[ext_resource type="Script" path="res://game/main.gd" id="1_i86db"]
[ext_resource type="PackedScene" uid="uid://u3g8s4kck61t" path="res://game/transition/transition.tscn" id="2_xhsf2"]
+[sub_resource type="Animation" id="Animation_krlic"]
+resource_name = "fade_in"
+tracks/0/type = "value"
+tracks/0/imported = false
+tracks/0/enabled = true
+tracks/0/path = NodePath("ColorRect:color")
+tracks/0/interp = 1
+tracks/0/loop_wrap = true
+tracks/0/keys = {
+"times": PackedFloat32Array(0, 1),
+"transitions": PackedFloat32Array(1, 1),
+"update": 0,
+"values": [Color(0, 0, 0, 1), Color(0, 0, 0, 0)]
+}
+
+[sub_resource type="Animation" id="Animation_q2678"]
+length = 0.001
+tracks/0/type = "value"
+tracks/0/imported = false
+tracks/0/enabled = true
+tracks/0/path = NodePath("ColorRect:color")
+tracks/0/interp = 1
+tracks/0/loop_wrap = true
+tracks/0/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 0,
+"values": [Color(0, 0, 0, 1)]
+}
+
+[sub_resource type="AnimationLibrary" id="AnimationLibrary_bnwsc"]
+_data = {
+"RESET": SubResource("Animation_q2678"),
+"fade_in": SubResource("Animation_krlic")
+}
+
[node name="Main" type="Node2D"]
script = ExtResource("1_i86db")
@@ -27,3 +63,19 @@ render_target_update_mode = 4
[node name="MicrogameTimer" type="Timer" parent="."]
unique_name_in_owner = true
wait_time = 5.0
+
+[node name="FadeLayer" type="CanvasLayer" parent="."]
+
+[node name="ColorRect" type="ColorRect" parent="FadeLayer"]
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+grow_horizontal = 2
+grow_vertical = 2
+color = Color(0, 0, 0, 1)
+
+[node name="FadeAnimationPlayer" type="AnimationPlayer" parent="FadeLayer"]
+unique_name_in_owner = true
+libraries = {
+"": SubResource("AnimationLibrary_bnwsc")
+}
diff --git a/game/shared/scripts/microgame.gd b/game/shared/scripts/microgame.gd
index 3acd624..15fbc69 100644
--- a/game/shared/scripts/microgame.gd
+++ b/game/shared/scripts/microgame.gd
@@ -18,7 +18,6 @@ func _ready():
timer.one_shot = true
timer.start(MICROGAME_TIMER)
-
timer.timeout.connect(func():
finished.emit(false)
)
diff --git a/game/transition/transition.tscn b/game/transition/transition.tscn
index 4982bc1..d9b7e6c 100644
--- a/game/transition/transition.tscn
+++ b/game/transition/transition.tscn
@@ -309,8 +309,8 @@ anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 360.0
offset_top = 68.0
-offset_right = -360.0
-offset_bottom = -360.0
+offset_right = 792.0
+offset_bottom = 288.0
grow_horizontal = 2
grow_vertical = 2
@@ -338,10 +338,10 @@ anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
-offset_left = -65.0
-offset_top = -440.0
-offset_right = 171.0
-offset_bottom = -330.0
+offset_left = 2815.0
+offset_top = 1180.0
+offset_right = 3051.0
+offset_bottom = 1290.0
grow_horizontal = 2
grow_vertical = 2
text = "blabla"