summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrique Alves <henrique.alves@itsjungle.xyz>2024-01-27 22:51:00 +0200
committerHenrique Alves <henrique.alves@itsjungle.xyz>2024-01-27 22:51:04 +0200
commited62e693a3fa5fc93d00d9bc7d3c2d1266d077be (patch)
treee18f722ac4129985c1e62e682d476b34d07f1b0f
parent9c50263e1a5959605fea2eaf4217b193840e7d0c (diff)
downloadgamejam-ggj-2024-ed62e693a3fa5fc93d00d9bc7d3c2d1266d077be.tar.gz
gamejam-ggj-2024-ed62e693a3fa5fc93d00d9bc7d3c2d1266d077be.tar.bz2
gamejam-ggj-2024-ed62e693a3fa5fc93d00d9bc7d3c2d1266d077be.zip
Add microgames to flow
-rw-r--r--game/main.gd20
-rw-r--r--game/main.tscn1
-rw-r--r--game/microgames/find_window/find_window.gd2
-rw-r--r--game/microgames/find_window/find_window.tscn5
-rw-r--r--game/microgames/flowers_delivery/flowers_delivery.gd3
-rw-r--r--game/microgames/flowers_delivery/flowers_delivery.tscn5
-rw-r--r--game/microgames/heart_break/heart_break.gd17
-rw-r--r--game/microgames/heart_break/heart_break.tscn12
-rw-r--r--game/microgames/heart_break/player_heart.gd1
-rw-r--r--game/shared/scripts/microgame.gd3
-rw-r--r--game/shared/timer/1.png (renamed from game/microgames/timer/1.png)bin326 -> 326 bytes
-rw-r--r--game/shared/timer/1.png.import (renamed from game/microgames/timer/1.png.import)6
-rw-r--r--game/shared/timer/2.png (renamed from game/microgames/timer/2.png)bin849 -> 849 bytes
-rw-r--r--game/shared/timer/2.png.import (renamed from game/microgames/timer/2.png.import)6
-rw-r--r--game/shared/timer/3.png (renamed from game/microgames/timer/3.png)bin1071 -> 1071 bytes
-rw-r--r--game/shared/timer/3.png.import (renamed from game/microgames/timer/3.png.import)6
-rw-r--r--game/shared/timer/4.png (renamed from game/microgames/timer/4.png)bin608 -> 608 bytes
-rw-r--r--game/shared/timer/4.png.import (renamed from game/microgames/timer/4.png.import)6
-rw-r--r--game/shared/timer/5.png (renamed from game/microgames/timer/5.png)bin924 -> 924 bytes
-rw-r--r--game/shared/timer/5.png.import (renamed from game/microgames/timer/5.png.import)6
-rw-r--r--game/shared/timer/Img_timer_1.png (renamed from game/microgames/timer/Img_timer_1.png)bin11470 -> 11470 bytes
-rw-r--r--game/shared/timer/Img_timer_1.png.import (renamed from game/microgames/timer/Img_timer_1.png.import)6
-rw-r--r--game/shared/timer/Img_timer_2.png (renamed from game/microgames/timer/Img_timer_2.png)bin11267 -> 11267 bytes
-rw-r--r--game/shared/timer/Img_timer_2.png.import (renamed from game/microgames/timer/Img_timer_2.png.import)6
-rw-r--r--game/transition/transition.tscn13
25 files changed, 65 insertions, 59 deletions
diff --git a/game/main.gd b/game/main.gd
index 68f2d3c..4c20e5a 100644
--- a/game/main.gd
+++ b/game/main.gd
@@ -1,6 +1,10 @@
extends Node2D
-const MICROGAMES = [preload("res://game/microgames/flowers_delivery/flowers_delivery.tscn")]
+var MICROGAMES = [
+ preload("res://game/microgames/flowers_delivery/flowers_delivery.tscn"),
+ preload("res://game/microgames/heart_break/heart_break.tscn"),
+ preload("res://game/microgames/find_window/find_window.tscn"),
+ ]
@onready var transition: Transition = %Transition
@onready var microgame_viewport = %MicrogameViewport
@@ -11,9 +15,14 @@ var _current_microgame: Microgame
var _starting = true
var _won_last_microgame = false
var _microgame_count = 1
+var _microgame_idx = 0
func _ready() -> void:
+ randomize()
+
+ MICROGAMES.shuffle()
+
%FadeAnimationPlayer.play("fade_in")
transition.reset()
transition.microgame_fade_out()
@@ -33,7 +42,11 @@ func _ready() -> void:
await transition.play_result_animation(_won_last_microgame)
- _current_microgame = MICROGAMES[0].instantiate()
+ _current_microgame = MICROGAMES[_microgame_idx].instantiate()
+ _microgame_idx = (_microgame_idx + 1) % MICROGAMES.size()
+ if _microgame_idx == 0:
+ MICROGAMES.shuffle()
+
microgame_subviewport.add_child(_current_microgame)
_current_microgame.process_mode = Node.PROCESS_MODE_DISABLED
@@ -46,7 +59,8 @@ func _ready() -> void:
_won_last_microgame = await _current_microgame.finished
_current_microgame.process_mode = Node.PROCESS_MODE_DISABLED
- await get_tree().create_timer(1.0).timeout
+ await get_tree().create_timer(0.5).timeout
_starting = false
_microgame_count += 1
+ Engine.time_scale = 1 + (_microgame_count * 0.05)
diff --git a/game/main.tscn b/game/main.tscn
index 29f0699..fac8c7f 100644
--- a/game/main.tscn
+++ b/game/main.tscn
@@ -72,6 +72,7 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
+mouse_filter = 2
color = Color(0, 0, 0, 1)
[node name="FadeAnimationPlayer" type="AnimationPlayer" parent="FadeLayer"]
diff --git a/game/microgames/find_window/find_window.gd b/game/microgames/find_window/find_window.gd
index 9d2ca64..6bc6e8e 100644
--- a/game/microgames/find_window/find_window.gd
+++ b/game/microgames/find_window/find_window.gd
@@ -2,7 +2,7 @@ extends Microgame
# Called when the node enters the scene tree for the first time.
-func _ready():
+func _microgame_ready():
var windows = $AllWindows.get_children()
var max_windows = windows.size() - randi_range(0,2)
for i in max_windows:
diff --git a/game/microgames/find_window/find_window.tscn b/game/microgames/find_window/find_window.tscn
index 6fe7233..b04e6c0 100644
--- a/game/microgames/find_window/find_window.tscn
+++ b/game/microgames/find_window/find_window.tscn
@@ -1,16 +1,17 @@
-[gd_scene load_steps=7 format=3 uid="uid://b8q2l65pajb3"]
+[gd_scene load_steps=7 format=3 uid="uid://cfitfl87k1wu2"]
[ext_resource type="Script" path="res://game/microgames/find_window/find_window.gd" id="1_167ws"]
[ext_resource type="Texture2D" uid="uid://j0btxfrk2q8k" path="res://game/microgames/find_window/assets/Img_background_windows.png" id="1_w06df"]
[ext_resource type="Texture2D" uid="uid://7h0hokgsxon4" path="res://game/microgames/find_window/assets/Img_MSN_namoradinha.png" id="3_ekh6x"]
[ext_resource type="Script" path="res://game/microgames/find_window/msn_girlfriend.gd" id="4_ithnb"]
-[ext_resource type="PackedScene" uid="uid://dxo3khe6emukf" path="res://game/microgames/find_window/msn_regular.tscn" id="4_t7t3v"]
+[ext_resource type="PackedScene" path="res://game/microgames/find_window/msn_regular.tscn" id="4_t7t3v"]
[sub_resource type="LabelSettings" id="LabelSettings_csx47"]
font_color = Color(0.443137, 0.443137, 0.443137, 1)
[node name="FindWindow" type="Node"]
script = ExtResource("1_167ws")
+win_on_timeout = false
[node name="ImgBackgroundWindows" type="Sprite2D" parent="."]
position = Vector2(578, 326)
diff --git a/game/microgames/flowers_delivery/flowers_delivery.gd b/game/microgames/flowers_delivery/flowers_delivery.gd
index 79001b1..d7f8772 100644
--- a/game/microgames/flowers_delivery/flowers_delivery.gd
+++ b/game/microgames/flowers_delivery/flowers_delivery.gd
@@ -3,5 +3,4 @@ extends Microgame
# Called when the node enters the scene tree for the first time.
func _microgame_ready() -> void:
- await $Timer.timeout
- finished.emit(true if randf() < 0.5 else false)
+ pass
diff --git a/game/microgames/flowers_delivery/flowers_delivery.tscn b/game/microgames/flowers_delivery/flowers_delivery.tscn
index 69a374e..3f26d72 100644
--- a/game/microgames/flowers_delivery/flowers_delivery.tscn
+++ b/game/microgames/flowers_delivery/flowers_delivery.tscn
@@ -54,8 +54,3 @@ transform = Transform3D(10, 0, 0, 0, 0.4, 0, 0, 0, 1, 1.5768, 2.47888, 7.67072)
modulate = Color(1, 0.301961, 0.231373, 1)
pixel_size = 1.0
texture = ExtResource("6_omk1m")
-
-[node name="Timer" type="Timer" parent="."]
-wait_time = 5.0
-one_shot = true
-autostart = true
diff --git a/game/microgames/heart_break/heart_break.gd b/game/microgames/heart_break/heart_break.gd
index d25afe8..63d7e5d 100644
--- a/game/microgames/heart_break/heart_break.gd
+++ b/game/microgames/heart_break/heart_break.gd
@@ -1,22 +1,13 @@
extends Microgame
-# Called when the node enters the scene tree for the first time.
-func _ready():
- pass # Replace with function body.
-
-
-# Called every frame. 'delta' is the elapsed time since the previous frame.
-func _process(delta):
- pass
-
func _on_player_heart_body_entered(body):
if body is Spiky:
disable_player()
- ## GameOver
- pass
+ finished.emit(false)
+
func disable_player():
- $PlayerHeart.get_node("AnimatedSprite2D").play("death")
- $PlayerHeart.playerControl = false
+ $PlayerHeart.get_node("AnimatedSprite2D").play("death")
+ $PlayerHeart.playerControl = false
diff --git a/game/microgames/heart_break/heart_break.tscn b/game/microgames/heart_break/heart_break.tscn
index a36d36d..b130424 100644
--- a/game/microgames/heart_break/heart_break.tscn
+++ b/game/microgames/heart_break/heart_break.tscn
@@ -14,7 +14,7 @@ size = Vector2(20, 676)
script = ExtResource("1_ia77r")
[node name="PlayerHeart" parent="." instance=ExtResource("2_uwtaj")]
-position = Vector2(563, 338)
+position = Vector2(553, 317)
[node name="Upper Boundary" type="StaticBody2D" parent="."]
@@ -43,18 +43,18 @@ position = Vector2(574, 0)
shape = SubResource("RectangleShape2D_upktn")
[node name="Spiky" parent="." instance=ExtResource("3_dfa23")]
-position = Vector2(239, 249)
+position = Vector2(182, 188)
[node name="Spiky2" parent="." instance=ExtResource("3_dfa23")]
-position = Vector2(891, 258)
+position = Vector2(964, 218)
[node name="Spiky3" parent="." instance=ExtResource("3_dfa23")]
-position = Vector2(284, 531)
+position = Vector2(235, 481)
[node name="Spiky4" parent="." instance=ExtResource("3_dfa23")]
-position = Vector2(821, 530)
+position = Vector2(845, 496)
[node name="Spiky5" parent="." instance=ExtResource("3_dfa23")]
-position = Vector2(570, 97)
+position = Vector2(570, 104)
[connection signal="body_entered" from="PlayerHeart" to="." method="_on_player_heart_body_entered"]
diff --git a/game/microgames/heart_break/player_heart.gd b/game/microgames/heart_break/player_heart.gd
index 0a6b26a..66847bb 100644
--- a/game/microgames/heart_break/player_heart.gd
+++ b/game/microgames/heart_break/player_heart.gd
@@ -13,5 +13,4 @@ func _physics_process(delta):
if(playerControl):
var moveVector = Vector2(Input.get_axis("Left","Right")*speed, Input.get_axis("Up","Down")*speed)
apply_force(moveVector)
- #set_axis_velocity(moveVector)
pass
diff --git a/game/shared/scripts/microgame.gd b/game/shared/scripts/microgame.gd
index 15fbc69..cde93ba 100644
--- a/game/shared/scripts/microgame.gd
+++ b/game/shared/scripts/microgame.gd
@@ -8,6 +8,7 @@ enum MICROGAME_CONTROL {HEAD_ON_KEYBOARD, INVERTED_HAND, ONLY_PINKY}
@export var microgame_name = ""
@export var microgame_control: MICROGAME_CONTROL
@export var instructions = ""
+@export var win_on_timeout = true
signal finished(won)
@@ -19,7 +20,7 @@ func _ready():
timer.start(MICROGAME_TIMER)
timer.timeout.connect(func():
- finished.emit(false)
+ finished.emit(win_on_timeout)
)
_microgame_ready()
diff --git a/game/microgames/timer/1.png b/game/shared/timer/1.png
index 2309354..2309354 100644
--- a/game/microgames/timer/1.png
+++ b/game/shared/timer/1.png
Binary files differ
diff --git a/game/microgames/timer/1.png.import b/game/shared/timer/1.png.import
index cabd829..8cbc42f 100644
--- a/game/microgames/timer/1.png.import
+++ b/game/shared/timer/1.png.import
@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://vme6xl77c48e"
-path="res://.godot/imported/1.png-5d82a92da481640997ba006709e4ccdb.ctex"
+path="res://.godot/imported/1.png-0b52cba24ff7e7d3772d1c2410140dc8.ctex"
metadata={
"vram_texture": false
}
[deps]
-source_file="res://game/microgames/timer/1.png"
-dest_files=["res://.godot/imported/1.png-5d82a92da481640997ba006709e4ccdb.ctex"]
+source_file="res://game/shared/timer/1.png"
+dest_files=["res://.godot/imported/1.png-0b52cba24ff7e7d3772d1c2410140dc8.ctex"]
[params]
diff --git a/game/microgames/timer/2.png b/game/shared/timer/2.png
index c56e8e4..c56e8e4 100644
--- a/game/microgames/timer/2.png
+++ b/game/shared/timer/2.png
Binary files differ
diff --git a/game/microgames/timer/2.png.import b/game/shared/timer/2.png.import
index 15818d8..2d201bf 100644
--- a/game/microgames/timer/2.png.import
+++ b/game/shared/timer/2.png.import
@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bu3mgglucxpjs"
-path="res://.godot/imported/2.png-655246e76f9819d1dc5d94826f0e5981.ctex"
+path="res://.godot/imported/2.png-b0d0a5caa261d0a0bb3281fd1a8c6731.ctex"
metadata={
"vram_texture": false
}
[deps]
-source_file="res://game/microgames/timer/2.png"
-dest_files=["res://.godot/imported/2.png-655246e76f9819d1dc5d94826f0e5981.ctex"]
+source_file="res://game/shared/timer/2.png"
+dest_files=["res://.godot/imported/2.png-b0d0a5caa261d0a0bb3281fd1a8c6731.ctex"]
[params]
diff --git a/game/microgames/timer/3.png b/game/shared/timer/3.png
index ab1fa51..ab1fa51 100644
--- a/game/microgames/timer/3.png
+++ b/game/shared/timer/3.png
Binary files differ
diff --git a/game/microgames/timer/3.png.import b/game/shared/timer/3.png.import
index e14dbc9..37b3b9c 100644
--- a/game/microgames/timer/3.png.import
+++ b/game/shared/timer/3.png.import
@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bt58qlhtr7b4d"
-path="res://.godot/imported/3.png-3c9deaaaf9e1e5ca8fc6429e4d7e85d3.ctex"
+path="res://.godot/imported/3.png-44f6171d385b4c76bdcfb28982ea3a0a.ctex"
metadata={
"vram_texture": false
}
[deps]
-source_file="res://game/microgames/timer/3.png"
-dest_files=["res://.godot/imported/3.png-3c9deaaaf9e1e5ca8fc6429e4d7e85d3.ctex"]
+source_file="res://game/shared/timer/3.png"
+dest_files=["res://.godot/imported/3.png-44f6171d385b4c76bdcfb28982ea3a0a.ctex"]
[params]
diff --git a/game/microgames/timer/4.png b/game/shared/timer/4.png
index 914340e..914340e 100644
--- a/game/microgames/timer/4.png
+++ b/game/shared/timer/4.png
Binary files differ
diff --git a/game/microgames/timer/4.png.import b/game/shared/timer/4.png.import
index b9a9f32..5d30c89 100644
--- a/game/microgames/timer/4.png.import
+++ b/game/shared/timer/4.png.import
@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cfur1citqmkd1"
-path="res://.godot/imported/4.png-1ed010bd22534d740e98c46dbc38c0a8.ctex"
+path="res://.godot/imported/4.png-6f36335f695c313dde72564b5fc5c310.ctex"
metadata={
"vram_texture": false
}
[deps]
-source_file="res://game/microgames/timer/4.png"
-dest_files=["res://.godot/imported/4.png-1ed010bd22534d740e98c46dbc38c0a8.ctex"]
+source_file="res://game/shared/timer/4.png"
+dest_files=["res://.godot/imported/4.png-6f36335f695c313dde72564b5fc5c310.ctex"]
[params]
diff --git a/game/microgames/timer/5.png b/game/shared/timer/5.png
index ae96437..ae96437 100644
--- a/game/microgames/timer/5.png
+++ b/game/shared/timer/5.png
Binary files differ
diff --git a/game/microgames/timer/5.png.import b/game/shared/timer/5.png.import
index 6a867ab..de970aa 100644
--- a/game/microgames/timer/5.png.import
+++ b/game/shared/timer/5.png.import
@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://n0sv45rq3u1d"
-path="res://.godot/imported/5.png-0abcf361d7381326898e8cfe995cdb31.ctex"
+path="res://.godot/imported/5.png-9f2b5bf152da765306875bec6cddb051.ctex"
metadata={
"vram_texture": false
}
[deps]
-source_file="res://game/microgames/timer/5.png"
-dest_files=["res://.godot/imported/5.png-0abcf361d7381326898e8cfe995cdb31.ctex"]
+source_file="res://game/shared/timer/5.png"
+dest_files=["res://.godot/imported/5.png-9f2b5bf152da765306875bec6cddb051.ctex"]
[params]
diff --git a/game/microgames/timer/Img_timer_1.png b/game/shared/timer/Img_timer_1.png
index 871eac5..871eac5 100644
--- a/game/microgames/timer/Img_timer_1.png
+++ b/game/shared/timer/Img_timer_1.png
Binary files differ
diff --git a/game/microgames/timer/Img_timer_1.png.import b/game/shared/timer/Img_timer_1.png.import
index b6ecf33..e67dc08 100644
--- a/game/microgames/timer/Img_timer_1.png.import
+++ b/game/shared/timer/Img_timer_1.png.import
@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://d1dtbc4srhlpl"
-path="res://.godot/imported/Img_timer_1.png-77492dfd45b09e0e06cc09db444e6742.ctex"
+path="res://.godot/imported/Img_timer_1.png-a11b1cf9226437df599cd52851dbe58f.ctex"
metadata={
"vram_texture": false
}
[deps]
-source_file="res://game/microgames/timer/Img_timer_1.png"
-dest_files=["res://.godot/imported/Img_timer_1.png-77492dfd45b09e0e06cc09db444e6742.ctex"]
+source_file="res://game/shared/timer/Img_timer_1.png"
+dest_files=["res://.godot/imported/Img_timer_1.png-a11b1cf9226437df599cd52851dbe58f.ctex"]
[params]
diff --git a/game/microgames/timer/Img_timer_2.png b/game/shared/timer/Img_timer_2.png
index a943e04..a943e04 100644
--- a/game/microgames/timer/Img_timer_2.png
+++ b/game/shared/timer/Img_timer_2.png
Binary files differ
diff --git a/game/microgames/timer/Img_timer_2.png.import b/game/shared/timer/Img_timer_2.png.import
index 43f6992..4d6c899 100644
--- a/game/microgames/timer/Img_timer_2.png.import
+++ b/game/shared/timer/Img_timer_2.png.import
@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://deb8hl537upa1"
-path="res://.godot/imported/Img_timer_2.png-14a9dea107fce83f2567d31062fff978.ctex"
+path="res://.godot/imported/Img_timer_2.png-56774a967d00c04e5e7920ca89db1260.ctex"
metadata={
"vram_texture": false
}
[deps]
-source_file="res://game/microgames/timer/Img_timer_2.png"
-dest_files=["res://.godot/imported/Img_timer_2.png-14a9dea107fce83f2567d31062fff978.ctex"]
+source_file="res://game/shared/timer/Img_timer_2.png"
+dest_files=["res://.godot/imported/Img_timer_2.png-56774a967d00c04e5e7920ca89db1260.ctex"]
[params]
diff --git a/game/transition/transition.tscn b/game/transition/transition.tscn
index d9b7e6c..608dc5b 100644
--- a/game/transition/transition.tscn
+++ b/game/transition/transition.tscn
@@ -290,6 +290,7 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
+mouse_filter = 2
[node name="ColorRect" type="ColorRect" parent="Background/BackgroundRect"]
layout_mode = 1
@@ -313,6 +314,7 @@ offset_right = 792.0
offset_bottom = 288.0
grow_horizontal = 2
grow_vertical = 2
+mouse_filter = 2
[node name="MicrogameViewportContainer" type="Control" parent="Foreground/ViewportContainer"]
unique_name_in_owner = true
@@ -322,6 +324,7 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
+mouse_filter = 2
[node name="ColorRect" type="ColorRect" parent="Foreground/ViewportContainer"]
layout_mode = 1
@@ -330,6 +333,7 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
+mouse_filter = 2
[node name="MicrogameCountLabel" type="Label" parent="Foreground"]
unique_name_in_owner = true
@@ -338,10 +342,10 @@ anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
-offset_left = 2815.0
-offset_top = 1180.0
-offset_right = 3051.0
-offset_bottom = 1290.0
+offset_left = 5119.0
+offset_top = 2476.0
+offset_right = 5355.0
+offset_bottom = 2586.0
grow_horizontal = 2
grow_vertical = 2
text = "blabla"
@@ -357,6 +361,7 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
+mouse_filter = 2
[node name="CharacterAnimation" parent="Foreground/Characters" instance=ExtResource("2_2nft6")]
position = Vector2(338, 305)