diff options
author | Henrique Alves <henrique.alves@itsjungle.xyz> | 2024-01-28 15:36:18 +0200 |
---|---|---|
committer | Henrique Alves <henrique.alves@itsjungle.xyz> | 2024-01-28 15:36:18 +0200 |
commit | 77dfeb0afae6937600d2bfd847e0151c9214e36d (patch) | |
tree | 2a963ea845a96e0ead6a5748a9bfca4a139b6b20 | |
parent | 39c5ed20a2eed5e5f358e2f00956f833ba60373b (diff) | |
download | gamejam-ggj-2024-77dfeb0afae6937600d2bfd847e0151c9214e36d.tar.gz gamejam-ggj-2024-77dfeb0afae6937600d2bfd847e0151c9214e36d.tar.bz2 gamejam-ggj-2024-77dfeb0afae6937600d2bfd847e0151c9214e36d.zip |
Add instruction label
-rw-r--r-- | game/MicrogameInstructionLabel.gd | 8 | ||||
-rw-r--r-- | game/instruction_popup.gd | 1 | ||||
-rw-r--r-- | game/main.gd | 5 | ||||
-rw-r--r-- | game/main.tscn | 30 | ||||
-rw-r--r-- | game/menu.tscn | 22 | ||||
-rw-r--r-- | game/microgames/find_window/find_window.tscn | 1 | ||||
-rw-r--r-- | game/microgames/flowers_delivery/flowers_delivery.tscn | 1 | ||||
-rw-r--r-- | game/microgames/heart_break/heart_break.tscn | 1 | ||||
-rw-r--r-- | game/transition/transition.tscn | 32 |
9 files changed, 71 insertions, 30 deletions
diff --git a/game/MicrogameInstructionLabel.gd b/game/MicrogameInstructionLabel.gd new file mode 100644 index 0000000..491a5a9 --- /dev/null +++ b/game/MicrogameInstructionLabel.gd @@ -0,0 +1,8 @@ +extends Label + + +func show_instruction(instruction): + text = instruction + var tween = create_tween() + tween.tween_property(self, "modulate", Color.WHITE, 0.1) + tween.tween_property(self, "modulate", Color(1,1,1,0), 0.1).set_delay(2) diff --git a/game/instruction_popup.gd b/game/instruction_popup.gd index 8bcad5e..6107e5b 100644 --- a/game/instruction_popup.gd +++ b/game/instruction_popup.gd @@ -18,7 +18,6 @@ func play_instruction(type: Microgame.MICROGAME_CONTROL): func get_instruction(type: Microgame.MICROGAME_CONTROL) -> InstructionResource: for instruction in instructions: - print(instruction.type) if instruction.type == type: return instruction return null diff --git a/game/main.gd b/game/main.gd index ebffaac..7e32d1e 100644 --- a/game/main.gd +++ b/game/main.gd @@ -69,7 +69,10 @@ func _ready() -> void: await instruction_popup.play_instruction(_current_microgame.microgame_control) Session.shown_types[_current_microgame.microgame_control] = true - await transition.show_instruction(instruction_popup.get_instruction(_current_microgame.microgame_control)) + var instruction_resource = instruction_popup.get_instruction(_current_microgame.microgame_control) + await transition.show_instruction(instruction_resource) + + %MicrogameInstructionLabel.show_instruction(_current_microgame.instructions) await transition.microgame_fade_in() diff --git a/game/main.tscn b/game/main.tscn index c6158b8..3eff98b 100644 --- a/game/main.tscn +++ b/game/main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=33 format=3 uid="uid://culqaacu08vye"] +[gd_scene load_steps=36 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"] @@ -18,6 +18,8 @@ [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"] +[ext_resource type="FontFile" uid="uid://den305djdhip6" path="res://game/shared/assets/SingleDay-Regular.ttf" id="19_vtcb7"] +[ext_resource type="Script" path="res://game/MicrogameInstructionLabel.gd" id="20_375k7"] [sub_resource type="Animation" id="Animation_q2678"] length = 0.001 @@ -258,6 +260,12 @@ _data = { "enter": SubResource("Animation_y56np") } +[sub_resource type="LabelSettings" id="LabelSettings_83xq3"] +font = ExtResource("19_vtcb7") +font_size = 64 +outline_size = 8 +outline_color = Color(0, 0, 0, 1) + [node name="Main" type="Node2D"] script = ExtResource("1_i86db") @@ -407,3 +415,23 @@ frame_progress = 0.440763 libraries = { "": SubResource("AnimationLibrary_m05d7") } + +[node name="MicrogameInstructionLabel" type="Label" parent="ForegroundLayer"] +unique_name_in_owner = true +modulate = Color(1, 1, 1, 0) +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -573.0 +offset_top = -24.0 +offset_right = 573.0 +offset_bottom = 25.0 +grow_horizontal = 2 +grow_vertical = 2 +text = "Rasdasdasdasdas" +label_settings = SubResource("LabelSettings_83xq3") +horizontal_alignment = 1 +vertical_alignment = 1 +script = ExtResource("20_375k7") diff --git a/game/menu.tscn b/game/menu.tscn index f628774..9764478 100644 --- a/game/menu.tscn +++ b/game/menu.tscn @@ -2,9 +2,8 @@ [ext_resource type="Script" path="res://game/menu.gd" id="1_24jgf"] -[sub_resource type="Animation" id="Animation_0210q"] -resource_name = "default" -length = 0.5 +[sub_resource type="Animation" id="Animation_amao6"] +length = 0.001 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true @@ -12,14 +11,15 @@ tracks/0/path = NodePath("Overlay:color") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { -"times": PackedFloat32Array(0, 0.5), -"transitions": PackedFloat32Array(1, 1), +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), "update": 0, -"values": [Color(0, 0, 0, 1), Color(0, 0, 0, 0)] +"values": [Color(0, 0, 0, 1)] } -[sub_resource type="Animation" id="Animation_amao6"] -length = 0.001 +[sub_resource type="Animation" id="Animation_0210q"] +resource_name = "default" +length = 0.5 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true @@ -27,10 +27,10 @@ tracks/0/path = NodePath("Overlay:color") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), +"times": PackedFloat32Array(0, 0.5), +"transitions": PackedFloat32Array(1, 1), "update": 0, -"values": [Color(0, 0, 0, 1)] +"values": [Color(0, 0, 0, 1), Color(0, 0, 0, 0)] } [sub_resource type="AnimationLibrary" id="AnimationLibrary_n3va2"] diff --git a/game/microgames/find_window/find_window.tscn b/game/microgames/find_window/find_window.tscn index f59d0a0..05a8a3b 100644 --- a/game/microgames/find_window/find_window.tscn +++ b/game/microgames/find_window/find_window.tscn @@ -12,6 +12,7 @@ font_color = Color(0.443137, 0.443137, 0.443137, 1) [node name="FindWindow" type="Node"] script = ExtResource("1_167ws") microgame_control = 1 +instructions = "Send the message!" win_on_timeout = false [node name="ImgBackgroundWindows" type="Sprite2D" parent="."] diff --git a/game/microgames/flowers_delivery/flowers_delivery.tscn b/game/microgames/flowers_delivery/flowers_delivery.tscn index 3f26d72..ce24711 100644 --- a/game/microgames/flowers_delivery/flowers_delivery.tscn +++ b/game/microgames/flowers_delivery/flowers_delivery.tscn @@ -32,6 +32,7 @@ animations = [{ [node name="FlowersDelivery" type="Node3D"] script = ExtResource("1_jhoh1") +instructions = "Meet your girlfriend!" [node name="Girlfriend" type="Sprite3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.45863, 1.42701, 0) diff --git a/game/microgames/heart_break/heart_break.tscn b/game/microgames/heart_break/heart_break.tscn index be0e847..933844e 100644 --- a/game/microgames/heart_break/heart_break.tscn +++ b/game/microgames/heart_break/heart_break.tscn @@ -13,6 +13,7 @@ size = Vector2(20, 676) [node name="HeartBreak" type="Node"] script = ExtResource("1_ia77r") microgame_control = 2 +instructions = "Dont break her heart!" [node name="PlayerHeart" parent="." instance=ExtResource("2_uwtaj")] position = Vector2(553, 317) diff --git a/game/transition/transition.tscn b/game/transition/transition.tscn index 19ae8f7..a1145fb 100644 --- a/game/transition/transition.tscn +++ b/game/transition/transition.tscn @@ -120,6 +120,22 @@ tracks/7/keys = { "values": [Vector2(-444, 91)] } +[sub_resource type="Animation" id="Animation_5h20a"] +resource_name = "instruction" +length = 1.6 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Foreground/InstructionTv:position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.3, 1.3, 1.6), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Vector2(-444, 91), Vector2(382, 91), Vector2(382, 91), Vector2(1195, 91)] +} + [sub_resource type="Animation" id="Animation_67853"] resource_name = "microgame_fade_out" length = 0.5 @@ -290,22 +306,6 @@ tracks/4/keys = { }] } -[sub_resource type="Animation" id="Animation_5h20a"] -resource_name = "instruction" -length = 1.6 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("Foreground/InstructionTv:position") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 0.3, 1.3, 1.6), -"transitions": PackedFloat32Array(1, 1, 1, 1), -"update": 0, -"values": [Vector2(-444, 91), Vector2(382, 91), Vector2(382, 91), Vector2(1195, 91)] -} - [sub_resource type="AnimationLibrary" id="AnimationLibrary_en0c8"] _data = { "RESET": SubResource("Animation_gf6gi"), |