summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrique Alves <henrique.alves@itsjungle.xyz>2024-01-28 12:59:06 +0200
committerHenrique Alves <henrique.alves@itsjungle.xyz>2024-01-28 13:00:10 +0200
commit5aa179deaa7cfc35b5bbc6abfba348deb0cc7017 (patch)
tree3439c6eccc415a10c4c4f7bef1fcb0538a4de9d7
parent40e31067f724d7a0570d622cc4d4dc0ee7233275 (diff)
downloadgamejam-ggj-2024-5aa179deaa7cfc35b5bbc6abfba348deb0cc7017.tar.gz
gamejam-ggj-2024-5aa179deaa7cfc35b5bbc6abfba348deb0cc7017.tar.bz2
gamejam-ggj-2024-5aa179deaa7cfc35b5bbc6abfba348deb0cc7017.zip
Add timer
-rw-r--r--game/explosion.gd8
-rw-r--r--game/main.gd11
-rw-r--r--game/main.tscn107
-rw-r--r--game/microgame_timer.gd40
-rw-r--r--game/microgames/baseball_kiss/baseball_kiss.gd2
-rw-r--r--game/microgames/baseball_kiss/baseball_kiss.tscn4
-rwxr-xr-xgame/shared/explosion/exp.pngbin0 -> 47453 bytes
-rw-r--r--game/shared/explosion/exp.png.import (renamed from game/shared/timer/Img_timer_2.png.import)8
-rw-r--r--game/shared/explosion/explosion.tscn134
-rwxr-xr-xgame/shared/explosion/explosion.wavbin0 -> 124000 bytes
-rw-r--r--game/shared/explosion/explosion.wav.import24
-rw-r--r--game/shared/scripts/microgame.gd15
-rw-r--r--game/shared/timer/Img_timer_2.pngbin11267 -> 0 bytes
-rw-r--r--game/transition/transition.tscn196
14 files changed, 416 insertions, 133 deletions
diff --git a/game/explosion.gd b/game/explosion.gd
new file mode 100644
index 0000000..5610e8e
--- /dev/null
+++ b/game/explosion.gd
@@ -0,0 +1,8 @@
+extends AnimatedSprite2D
+
+
+func explode():
+ show()
+ frame = 0
+ play("default")
+ $AudioStreamPlayer.play()
diff --git a/game/main.gd b/game/main.gd
index e723c29..6d95c1e 100644
--- a/game/main.gd
+++ b/game/main.gd
@@ -54,17 +54,20 @@ func _ready() -> void:
await transition.play_microgame_count(_microgame_count)
- if not Session.shown_types.has(_current_microgame.microgame_control):
- await instruction_popup.play_instruction(_current_microgame.microgame_control)
- Session.shown_types[_current_microgame.microgame_control] = true
+ #if not Session.shown_types.has(_current_microgame.microgame_control):
+ #await instruction_popup.play_instruction(_current_microgame.microgame_control)
+ #Session.shown_types[_current_microgame.microgame_control] = true
await transition.microgame_fade_in()
-
+ %MicrogameTvTimer.play()
_current_microgame.process_mode = Node.PROCESS_MODE_INHERIT
_won_last_microgame = await _current_microgame.finished
_current_microgame.process_mode = Node.PROCESS_MODE_DISABLED
+ if _current_microgame.get_time_left() > 0.001:
+ %MicrogameTvTimer.finish()
+
await get_tree().create_timer(0.5).timeout
_starting = false
diff --git a/game/main.tscn b/game/main.tscn
index e64109c..f315a69 100644
--- a/game/main.tscn
+++ b/game/main.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=20 format=3 uid="uid://culqaacu08vye"]
+[gd_scene load_steps=30 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"]
@@ -7,7 +7,14 @@
[ext_resource type="Texture2D" uid="uid://dv4646lxakb8d" path="res://game/shared/tutorial/assets/Img_maos_trocadas.png" id="4_xg44k"]
[ext_resource type="Texture2D" uid="uid://b81bbfen65gm3" path="res://game/shared/tutorial/assets/Img_reverencia.png" id="5_lhn6w"]
[ext_resource type="Texture2D" uid="uid://cxhuyyforfxwm" path="res://game/shared/tutorial/assets/Img_mindinho.png" id="6_go5ee"]
-[ext_resource type="Texture2D" uid="uid://qf4u4kat18k7" path="res://game/shared/tutorial/assets/Img_maos_trocadas_mouse.png" id="8_lgnra"]
+[ext_resource type="Script" path="res://game/microgame_timer.gd" id="8_ygcq8"]
+[ext_resource type="Texture2D" uid="uid://n0sv45rq3u1d" path="res://game/shared/timer/5.png" id="9_yhgor"]
+[ext_resource type="Texture2D" uid="uid://cfur1citqmkd1" path="res://game/shared/timer/4.png" id="10_v6xue"]
+[ext_resource type="Texture2D" uid="uid://bt58qlhtr7b4d" path="res://game/shared/timer/3.png" id="11_gpmug"]
+[ext_resource type="Texture2D" uid="uid://bu3mgglucxpjs" path="res://game/shared/timer/2.png" id="12_igwy3"]
+[ext_resource type="Texture2D" uid="uid://vme6xl77c48e" path="res://game/shared/timer/1.png" id="13_mb5n2"]
+[ext_resource type="Texture2D" uid="uid://d1dtbc4srhlpl" path="res://game/shared/timer/Img_timer_1.png" id="14_e5s51"]
+[ext_resource type="PackedScene" uid="uid://bqbngfstmish5" path="res://game/shared/explosion/explosion.tscn" id="15_macy5"]
[sub_resource type="Animation" id="Animation_q2678"]
length = 0.001
@@ -107,7 +114,7 @@ tracks/1/keys = {
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
-tracks/2/path = NodePath("%LabelTitle:modulate")
+tracks/2/path = NodePath("LabelTitle:modulate")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
@@ -119,7 +126,7 @@ tracks/2/keys = {
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
-tracks/3/path = NodePath("%Label1:modulate")
+tracks/3/path = NodePath("Label1:modulate")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
@@ -131,7 +138,7 @@ tracks/3/keys = {
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
-tracks/4/path = NodePath("%Label2:modulate")
+tracks/4/path = NodePath("Label2:modulate")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
@@ -171,7 +178,7 @@ tracks/1/keys = {
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
-tracks/2/path = NodePath("%LabelTitle:modulate")
+tracks/2/path = NodePath("LabelTitle:modulate")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
@@ -183,7 +190,7 @@ tracks/2/keys = {
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
-tracks/3/path = NodePath("%Label1:modulate")
+tracks/3/path = NodePath("Label1:modulate")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
@@ -195,7 +202,7 @@ tracks/3/keys = {
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
-tracks/4/path = NodePath("%Label2:modulate")
+tracks/4/path = NodePath("Label2:modulate")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
@@ -211,6 +218,43 @@ _data = {
"start": SubResource("Animation_4nygo")
}
+[sub_resource type="Animation" id="Animation_y56np"]
+resource_name = "enter"
+length = 0.5
+tracks/0/type = "value"
+tracks/0/imported = false
+tracks/0/enabled = true
+tracks/0/path = NodePath(".:position")
+tracks/0/interp = 1
+tracks/0/loop_wrap = true
+tracks/0/keys = {
+"times": PackedFloat32Array(0, 0.5),
+"transitions": PackedFloat32Array(0.267943, 0.267943),
+"update": 0,
+"values": [Vector2(125, 722), Vector2(125, 547)]
+}
+
+[sub_resource type="Animation" id="Animation_0006q"]
+length = 0.001
+tracks/0/type = "value"
+tracks/0/imported = false
+tracks/0/enabled = true
+tracks/0/path = NodePath(".:position")
+tracks/0/interp = 1
+tracks/0/loop_wrap = true
+tracks/0/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 0,
+"values": [Vector2(125, 722)]
+}
+
+[sub_resource type="AnimationLibrary" id="AnimationLibrary_m05d7"]
+_data = {
+"RESET": SubResource("Animation_0006q"),
+"enter": SubResource("Animation_y56np")
+}
+
[node name="Main" type="Node2D"]
script = ExtResource("1_i86db")
@@ -253,9 +297,9 @@ libraries = {
"": SubResource("AnimationLibrary_bnwsc")
}
-[node name="InstructionLayer" type="CanvasLayer" parent="."]
+[node name="ForegroundLayer" type="CanvasLayer" parent="."]
-[node name="InstructionPopup" type="Control" parent="InstructionLayer"]
+[node name="InstructionPopup" type="Control" parent="ForegroundLayer"]
unique_name_in_owner = true
visible = false
modulate = Color(1, 1, 1, 0)
@@ -268,7 +312,7 @@ grow_vertical = 2
script = ExtResource("3_lei0q")
instructions = Array[ExtResource("4_30kv1")]([SubResource("Resource_o6d01"), SubResource("Resource_sjq73"), SubResource("Resource_40y54")])
-[node name="ColorRect" type="ColorRect" parent="InstructionLayer/InstructionPopup"]
+[node name="ColorRect" type="ColorRect" parent="ForegroundLayer/InstructionPopup"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
@@ -277,7 +321,7 @@ grow_horizontal = 2
grow_vertical = 2
color = Color(0.701961, 0.564706, 0.968627, 1)
-[node name="TextureZoeira" type="TextureRect" parent="InstructionLayer/InstructionPopup"]
+[node name="TextureZoeira" type="TextureRect" parent="ForegroundLayer/InstructionPopup"]
unique_name_in_owner = true
layout_mode = 0
offset_left = 28.0
@@ -286,16 +330,16 @@ offset_right = 399.0
offset_bottom = 638.0
texture = ExtResource("4_xg44k")
-[node name="TextureInstruction" type="TextureRect" parent="InstructionLayer/InstructionPopup"]
+[node name="TextureInstruction" type="TextureRect" parent="ForegroundLayer/InstructionPopup"]
unique_name_in_owner = true
layout_mode = 0
offset_left = 736.0
offset_top = 17.0
offset_right = 1107.0
offset_bottom = 388.0
-texture = ExtResource("8_lgnra")
+texture = ExtResource("4_xg44k")
-[node name="LabelTitle" type="Label" parent="InstructionLayer/InstructionPopup"]
+[node name="LabelTitle" type="Label" parent="ForegroundLayer/InstructionPopup"]
unique_name_in_owner = true
modulate = Color(1, 1, 1, 0)
layout_mode = 0
@@ -306,7 +350,7 @@ offset_bottom = 174.0
text = "Replace Hands"
label_settings = SubResource("LabelSettings_wskk0")
-[node name="Label1" type="Label" parent="InstructionLayer/InstructionPopup"]
+[node name="Label1" type="Label" parent="ForegroundLayer/InstructionPopup"]
unique_name_in_owner = true
modulate = Color(1, 1, 1, 0)
layout_mode = 0
@@ -317,7 +361,7 @@ offset_bottom = 506.0
text = "Use your non-dominant hand with the mouse"
label_settings = SubResource("LabelSettings_wx7qq")
-[node name="Label2" type="Label" parent="InstructionLayer/InstructionPopup"]
+[node name="Label2" type="Label" parent="ForegroundLayer/InstructionPopup"]
unique_name_in_owner = true
modulate = Color(1, 1, 1, 0)
layout_mode = 0
@@ -329,7 +373,34 @@ text = "To train not using one, but two hands with your loved one"
label_settings = SubResource("LabelSettings_wx7qq")
autowrap_mode = 2
-[node name="AnimationPlayer" type="AnimationPlayer" parent="InstructionLayer/InstructionPopup"]
+[node name="AnimationPlayer" type="AnimationPlayer" parent="ForegroundLayer/InstructionPopup"]
libraries = {
"": SubResource("AnimationLibrary_ljsnm")
}
+
+[node name="MicrogameTvTimer" type="Node2D" parent="ForegroundLayer"]
+unique_name_in_owner = true
+position = Vector2(125, 722)
+scale = Vector2(1.5, 1.5)
+script = ExtResource("8_ygcq8")
+number_sprites = Array[Texture2D]([ExtResource("9_yhgor"), ExtResource("10_v6xue"), ExtResource("11_gpmug"), ExtResource("12_igwy3"), ExtResource("13_mb5n2")])
+
+[node name="TVSprite" type="Sprite2D" parent="ForegroundLayer/MicrogameTvTimer"]
+unique_name_in_owner = true
+texture = ExtResource("14_e5s51")
+
+[node name="NumberSprite" type="Sprite2D" parent="ForegroundLayer/MicrogameTvTimer"]
+unique_name_in_owner = true
+position = Vector2(-7, -3)
+texture = ExtResource("13_mb5n2")
+
+[node name="Explosion" parent="ForegroundLayer/MicrogameTvTimer" instance=ExtResource("15_macy5")]
+unique_name_in_owner = true
+autoplay = ""
+frame = 7
+frame_progress = 0.440763
+
+[node name="AnimationPlayer" type="AnimationPlayer" parent="ForegroundLayer/MicrogameTvTimer"]
+libraries = {
+"": SubResource("AnimationLibrary_m05d7")
+}
diff --git a/game/microgame_timer.gd b/game/microgame_timer.gd
new file mode 100644
index 0000000..4664857
--- /dev/null
+++ b/game/microgame_timer.gd
@@ -0,0 +1,40 @@
+extends Node2D
+
+@export var number_sprites: Array[Texture2D]
+
+var sprite_idx = 0
+var timer = 0.0
+var _playing = false
+
+func play():
+ sprite_idx = 0
+ timer = 0.0
+ show()
+ %TVSprite.show()
+ %NumberSprite.show()
+ %Explosion.hide()
+ $AnimationPlayer.play("enter")
+ ($AnimationPlayer as AnimationPlayer).seek(0, true)
+ _playing = true
+
+
+func finish():
+ _playing = false
+ $AnimationPlayer.play_backwards("enter")
+
+
+func _physics_process(delta):
+ if not _playing:
+ return
+
+ timer += delta
+ var idx = clamp(int(timer), 0, 4)
+ %NumberSprite.texture = number_sprites[idx]
+
+ if timer > 5.0:
+ _playing = false
+ %TVSprite.hide()
+ %NumberSprite.hide()
+ %Explosion.explode()
+ await get_tree().create_timer(0.6).timeout
+ hide()
diff --git a/game/microgames/baseball_kiss/baseball_kiss.gd b/game/microgames/baseball_kiss/baseball_kiss.gd
index 27c0b15..ba03388 100644
--- a/game/microgames/baseball_kiss/baseball_kiss.gd
+++ b/game/microgames/baseball_kiss/baseball_kiss.gd
@@ -10,7 +10,7 @@ var path = null
func _microgame_ready():
var paths = $Paths.get_children()
var choose_path = randi_range(0, paths.size()-1)
- print(choose_path)
+
path = paths[choose_path].get_child(0)
path.rotates = false
kiss.reparent(path)
diff --git a/game/microgames/baseball_kiss/baseball_kiss.tscn b/game/microgames/baseball_kiss/baseball_kiss.tscn
index c2c032f..9d6abd7 100644
--- a/game/microgames/baseball_kiss/baseball_kiss.tscn
+++ b/game/microgames/baseball_kiss/baseball_kiss.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=22 format=3 uid="uid://tbv0acwtfx1t"]
+[gd_scene load_steps=22 format=3 uid="uid://h4y7kn003ao1"]
[ext_resource type="Script" path="res://game/microgames/baseball_kiss/baseball_kiss.gd" id="1_urxm5"]
[ext_resource type="Texture2D" uid="uid://1mnstkvhabph" path="res://game/microgames/baseball_kiss/assets/Img_background_windows.png" id="2_odjhy"]
@@ -177,7 +177,7 @@ scale = Vector2(0.3, 0.3)
curve = SubResource("Curve2D_hb7qp")
[node name="PathFollow2D" type="PathFollow2D" parent="Paths/ParthLeft"]
-position = Vector2(-1751.22, -68.4033)
+position = Vector2(-1751.22, -68.4037)
rotation = -0.271729
progress = 3626.66
diff --git a/game/shared/explosion/exp.png b/game/shared/explosion/exp.png
new file mode 100755
index 0000000..addc212
--- /dev/null
+++ b/game/shared/explosion/exp.png
Binary files differ
diff --git a/game/shared/timer/Img_timer_2.png.import b/game/shared/explosion/exp.png.import
index 4d6c899..eff80ab 100644
--- a/game/shared/timer/Img_timer_2.png.import
+++ b/game/shared/explosion/exp.png.import
@@ -2,16 +2,16 @@
importer="texture"
type="CompressedTexture2D"
-uid="uid://deb8hl537upa1"
-path="res://.godot/imported/Img_timer_2.png-56774a967d00c04e5e7920ca89db1260.ctex"
+uid="uid://8abra05bev3b"
+path="res://.godot/imported/exp.png-678be4d75d87644797d4d4328de5d75f.ctex"
metadata={
"vram_texture": false
}
[deps]
-source_file="res://game/shared/timer/Img_timer_2.png"
-dest_files=["res://.godot/imported/Img_timer_2.png-56774a967d00c04e5e7920ca89db1260.ctex"]
+source_file="res://game/shared/explosion/exp.png"
+dest_files=["res://.godot/imported/exp.png-678be4d75d87644797d4d4328de5d75f.ctex"]
[params]
diff --git a/game/shared/explosion/explosion.tscn b/game/shared/explosion/explosion.tscn
new file mode 100644
index 0000000..4762e81
--- /dev/null
+++ b/game/shared/explosion/explosion.tscn
@@ -0,0 +1,134 @@
+[gd_scene load_steps=21 format=3 uid="uid://bqbngfstmish5"]
+
+[ext_resource type="Texture2D" uid="uid://8abra05bev3b" path="res://game/shared/explosion/exp.png" id="1_kjyh7"]
+[ext_resource type="Script" path="res://game/explosion.gd" id="2_1jen5"]
+[ext_resource type="AudioStream" uid="uid://dvwbn5r2l3ol7" path="res://game/shared/explosion/explosion.wav" id="3_wtj5u"]
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_plmyp"]
+atlas = ExtResource("1_kjyh7")
+region = Rect2(0, 0, 64, 64)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_dhqph"]
+atlas = ExtResource("1_kjyh7")
+region = Rect2(64, 0, 64, 64)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_060gj"]
+atlas = ExtResource("1_kjyh7")
+region = Rect2(128, 0, 64, 64)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_ottke"]
+atlas = ExtResource("1_kjyh7")
+region = Rect2(192, 0, 64, 64)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_krhkr"]
+atlas = ExtResource("1_kjyh7")
+region = Rect2(0, 64, 64, 64)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_eunpj"]
+atlas = ExtResource("1_kjyh7")
+region = Rect2(64, 64, 64, 64)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_0asdp"]
+atlas = ExtResource("1_kjyh7")
+region = Rect2(128, 64, 64, 64)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_o5oir"]
+atlas = ExtResource("1_kjyh7")
+region = Rect2(192, 64, 64, 64)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_olqn8"]
+atlas = ExtResource("1_kjyh7")
+region = Rect2(0, 128, 64, 64)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_nq5n7"]
+atlas = ExtResource("1_kjyh7")
+region = Rect2(64, 128, 64, 64)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_gyecm"]
+atlas = ExtResource("1_kjyh7")
+region = Rect2(128, 128, 64, 64)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_ua8hk"]
+atlas = ExtResource("1_kjyh7")
+region = Rect2(192, 128, 64, 64)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_p43u0"]
+atlas = ExtResource("1_kjyh7")
+region = Rect2(0, 192, 64, 64)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_pyqsk"]
+atlas = ExtResource("1_kjyh7")
+region = Rect2(64, 192, 64, 64)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_1nm4e"]
+atlas = ExtResource("1_kjyh7")
+region = Rect2(128, 192, 64, 64)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_wwd08"]
+atlas = ExtResource("1_kjyh7")
+region = Rect2(192, 192, 64, 64)
+
+[sub_resource type="SpriteFrames" id="SpriteFrames_el6y5"]
+animations = [{
+"frames": [{
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_plmyp")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_dhqph")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_060gj")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_ottke")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_krhkr")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_eunpj")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_0asdp")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_o5oir")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_olqn8")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_nq5n7")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_gyecm")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_ua8hk")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_p43u0")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_pyqsk")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_1nm4e")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_wwd08")
+}],
+"loop": false,
+"name": &"default",
+"speed": 30.0
+}]
+
+[node name="Explosion" type="AnimatedSprite2D"]
+visible = false
+sprite_frames = SubResource("SpriteFrames_el6y5")
+autoplay = "default"
+script = ExtResource("2_1jen5")
+
+[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
+stream = ExtResource("3_wtj5u")
diff --git a/game/shared/explosion/explosion.wav b/game/shared/explosion/explosion.wav
new file mode 100755
index 0000000..86d8570
--- /dev/null
+++ b/game/shared/explosion/explosion.wav
Binary files differ
diff --git a/game/shared/explosion/explosion.wav.import b/game/shared/explosion/explosion.wav.import
new file mode 100644
index 0000000..45e8cb3
--- /dev/null
+++ b/game/shared/explosion/explosion.wav.import
@@ -0,0 +1,24 @@
+[remap]
+
+importer="wav"
+type="AudioStreamWAV"
+uid="uid://dvwbn5r2l3ol7"
+path="res://.godot/imported/explosion.wav-6073403ca2d95c6ce12d339dfef46831.sample"
+
+[deps]
+
+source_file="res://game/shared/explosion/explosion.wav"
+dest_files=["res://.godot/imported/explosion.wav-6073403ca2d95c6ce12d339dfef46831.sample"]
+
+[params]
+
+force/8_bit=false
+force/mono=false
+force/max_rate=false
+force/max_rate_hz=44100
+edit/trim=false
+edit/normalize=false
+edit/loop_mode=0
+edit/loop_begin=0
+edit/loop_end=-1
+compress/mode=0
diff --git a/game/shared/scripts/microgame.gd b/game/shared/scripts/microgame.gd
index cde93ba..1f38842 100644
--- a/game/shared/scripts/microgame.gd
+++ b/game/shared/scripts/microgame.gd
@@ -10,16 +10,21 @@ enum MICROGAME_CONTROL {HEAD_ON_KEYBOARD, INVERTED_HAND, ONLY_PINKY}
@export var instructions = ""
@export var win_on_timeout = true
+var _timer: Timer
+
signal finished(won)
+func get_time_left():
+ return _timer.time_left
+
func _ready():
- var timer = Timer.new()
- add_child(timer)
- timer.one_shot = true
- timer.start(MICROGAME_TIMER)
+ _timer = Timer.new()
+ add_child(_timer)
+ _timer.one_shot = true
+ _timer.start(MICROGAME_TIMER)
- timer.timeout.connect(func():
+ _timer.timeout.connect(func():
finished.emit(win_on_timeout)
)
diff --git a/game/shared/timer/Img_timer_2.png b/game/shared/timer/Img_timer_2.png
deleted file mode 100644
index a943e04..0000000
--- a/game/shared/timer/Img_timer_2.png
+++ /dev/null
Binary files differ
diff --git a/game/transition/transition.tscn b/game/transition/transition.tscn
index 608dc5b..d748f70 100644
--- a/game/transition/transition.tscn
+++ b/game/transition/transition.tscn
@@ -13,6 +13,93 @@ font = ExtResource("2_phg5r")
font_size = 80
font_color = Color(0, 0, 0, 1)
+[sub_resource type="Animation" id="Animation_gf6gi"]
+length = 0.001
+tracks/0/type = "value"
+tracks/0/imported = false
+tracks/0/enabled = true
+tracks/0/path = NodePath("Foreground/ViewportContainer/ColorRect:color")
+tracks/0/interp = 1
+tracks/0/loop_wrap = true
+tracks/0/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 0,
+"values": [Color(1, 1, 1, 1)]
+}
+tracks/1/type = "value"
+tracks/1/imported = false
+tracks/1/enabled = true
+tracks/1/path = NodePath("Foreground/ViewportContainer:size")
+tracks/1/interp = 1
+tracks/1/loop_wrap = true
+tracks/1/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 0,
+"values": [Vector2(432, 220)]
+}
+tracks/2/type = "value"
+tracks/2/imported = false
+tracks/2/enabled = true
+tracks/2/path = NodePath("Foreground/ViewportContainer:position")
+tracks/2/interp = 1
+tracks/2/loop_wrap = true
+tracks/2/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 0,
+"values": [Vector2(360, 68)]
+}
+tracks/3/type = "value"
+tracks/3/imported = false
+tracks/3/enabled = true
+tracks/3/path = NodePath("Foreground/Characters/CharacterAnimation:position")
+tracks/3/interp = 1
+tracks/3/loop_wrap = true
+tracks/3/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 0,
+"values": [Vector2(338, 305)]
+}
+tracks/4/type = "value"
+tracks/4/imported = false
+tracks/4/enabled = true
+tracks/4/path = NodePath("Foreground/Characters/CharacterAnimation2:position")
+tracks/4/interp = 1
+tracks/4/loop_wrap = true
+tracks/4/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 0,
+"values": [Vector2(163, 386)]
+}
+tracks/5/type = "value"
+tracks/5/imported = false
+tracks/5/enabled = true
+tracks/5/path = NodePath("Foreground/Characters/CharacterAnimation3:position")
+tracks/5/interp = 1
+tracks/5/loop_wrap = true
+tracks/5/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 0,
+"values": [Vector2(820, 306)]
+}
+tracks/6/type = "value"
+tracks/6/imported = false
+tracks/6/enabled = true
+tracks/6/path = NodePath("Foreground/Characters/CharacterAnimation4:position")
+tracks/6/interp = 1
+tracks/6/loop_wrap = true
+tracks/6/keys = {
+"times": PackedFloat32Array(0),
+"transitions": PackedFloat32Array(1),
+"update": 0,
+"values": [Vector2(982, 389)]
+}
+
[sub_resource type="Animation" id="Animation_67853"]
resource_name = "microgame_fade_out"
length = 0.5
@@ -183,93 +270,6 @@ tracks/4/keys = {
}]
}
-[sub_resource type="Animation" id="Animation_gf6gi"]
-length = 0.001
-tracks/0/type = "value"
-tracks/0/imported = false
-tracks/0/enabled = true
-tracks/0/path = NodePath("Foreground/ViewportContainer/ColorRect:color")
-tracks/0/interp = 1
-tracks/0/loop_wrap = true
-tracks/0/keys = {
-"times": PackedFloat32Array(0),
-"transitions": PackedFloat32Array(1),
-"update": 0,
-"values": [Color(1, 1, 1, 1)]
-}
-tracks/1/type = "value"
-tracks/1/imported = false
-tracks/1/enabled = true
-tracks/1/path = NodePath("Foreground/ViewportContainer:size")
-tracks/1/interp = 1
-tracks/1/loop_wrap = true
-tracks/1/keys = {
-"times": PackedFloat32Array(0),
-"transitions": PackedFloat32Array(1),
-"update": 0,
-"values": [Vector2(432, 220)]
-}
-tracks/2/type = "value"
-tracks/2/imported = false
-tracks/2/enabled = true
-tracks/2/path = NodePath("Foreground/ViewportContainer:position")
-tracks/2/interp = 1
-tracks/2/loop_wrap = true
-tracks/2/keys = {
-"times": PackedFloat32Array(0),
-"transitions": PackedFloat32Array(1),
-"update": 0,
-"values": [Vector2(360, 68)]
-}
-tracks/3/type = "value"
-tracks/3/imported = false
-tracks/3/enabled = true
-tracks/3/path = NodePath("Foreground/Characters/CharacterAnimation:position")
-tracks/3/interp = 1
-tracks/3/loop_wrap = true
-tracks/3/keys = {
-"times": PackedFloat32Array(0),
-"transitions": PackedFloat32Array(1),
-"update": 0,
-"values": [Vector2(338, 305)]
-}
-tracks/4/type = "value"
-tracks/4/imported = false
-tracks/4/enabled = true
-tracks/4/path = NodePath("Foreground/Characters/CharacterAnimation2:position")
-tracks/4/interp = 1
-tracks/4/loop_wrap = true
-tracks/4/keys = {
-"times": PackedFloat32Array(0),
-"transitions": PackedFloat32Array(1),
-"update": 0,
-"values": [Vector2(163, 386)]
-}
-tracks/5/type = "value"
-tracks/5/imported = false
-tracks/5/enabled = true
-tracks/5/path = NodePath("Foreground/Characters/CharacterAnimation3:position")
-tracks/5/interp = 1
-tracks/5/loop_wrap = true
-tracks/5/keys = {
-"times": PackedFloat32Array(0),
-"transitions": PackedFloat32Array(1),
-"update": 0,
-"values": [Vector2(820, 306)]
-}
-tracks/6/type = "value"
-tracks/6/imported = false
-tracks/6/enabled = true
-tracks/6/path = NodePath("Foreground/Characters/CharacterAnimation4:position")
-tracks/6/interp = 1
-tracks/6/loop_wrap = true
-tracks/6/keys = {
-"times": PackedFloat32Array(0),
-"transitions": PackedFloat32Array(1),
-"update": 0,
-"values": [Vector2(982, 389)]
-}
-
[sub_resource type="AnimationLibrary" id="AnimationLibrary_en0c8"]
_data = {
"RESET": SubResource("Animation_gf6gi"),
@@ -342,10 +342,10 @@ anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
-offset_left = 5119.0
-offset_top = 2476.0
-offset_right = 5355.0
-offset_bottom = 2586.0
+offset_left = 5695.0
+offset_top = 2800.0
+offset_right = 5931.0
+offset_bottom = 2910.0
grow_horizontal = 2
grow_vertical = 2
text = "blabla"
@@ -365,7 +365,6 @@ mouse_filter = 2
[node name="CharacterAnimation" parent="Foreground/Characters" instance=ExtResource("2_2nft6")]
position = Vector2(338, 305)
-scale = Vector2(2, 2)
sprite_frames = ExtResource("3_gxf7f")
[node name="Sprite2D2" type="Sprite2D" parent="Foreground/Characters/CharacterAnimation"]
@@ -374,11 +373,10 @@ position = Vector2(-14, 12)
texture = ExtResource("4_wxw0m")
offset = Vector2(2.08165e-12, 2.08165e-12)
hframes = 3
-vframes = 9
+vframes = 5
[node name="CharacterAnimation2" parent="Foreground/Characters" instance=ExtResource("2_2nft6")]
position = Vector2(163, 386)
-scale = Vector2(2, 2)
[node name="Sprite2D" type="Sprite2D" parent="Foreground/Characters/CharacterAnimation2"]
show_behind_parent = true
@@ -386,11 +384,11 @@ position = Vector2(-18, 5)
texture = ExtResource("4_wxw0m")
offset = Vector2(2.08165e-12, 2.08165e-12)
hframes = 3
-vframes = 9
+vframes = 5
[node name="CharacterAnimation3" parent="Foreground/Characters" instance=ExtResource("2_2nft6")]
position = Vector2(820, 306)
-scale = Vector2(-2, 2)
+scale = Vector2(-1, 1)
sprite_frames = ExtResource("5_l50r6")
[node name="Sprite2D3" type="Sprite2D" parent="Foreground/Characters/CharacterAnimation3"]
@@ -399,11 +397,11 @@ position = Vector2(5, 18)
texture = ExtResource("4_wxw0m")
offset = Vector2(2.08165e-12, 2.08165e-12)
hframes = 3
-vframes = 9
+vframes = 5
[node name="CharacterAnimation4" parent="Foreground/Characters" instance=ExtResource("2_2nft6")]
position = Vector2(982, 389)
-scale = Vector2(-2, 2)
+scale = Vector2(-1, 1)
sprite_frames = ExtResource("6_eiuh1")
[node name="Sprite2D4" type="Sprite2D" parent="Foreground/Characters/CharacterAnimation4"]
@@ -412,7 +410,7 @@ position = Vector2(0, -1)
texture = ExtResource("4_wxw0m")
offset = Vector2(2.08165e-12, 2.08165e-12)
hframes = 3
-vframes = 9
+vframes = 5
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
unique_name_in_owner = true