diff options
author | Henrique Alves <henrique.alves@itsjungle.xyz> | 2024-01-27 23:59:31 +0200 |
---|---|---|
committer | Henrique Alves <henrique.alves@itsjungle.xyz> | 2024-01-27 23:59:31 +0200 |
commit | 01d02b389d3ba302c84986295ec06839cf4d4918 (patch) | |
tree | c15fda2a96ec9e0aecbabc3028db3952a3cd7350 | |
parent | a38fc38e0e2a44732b87bfcbdcc0e5aaae6c3167 (diff) | |
download | gamejam-ggj-2024-01d02b389d3ba302c84986295ec06839cf4d4918.tar.gz gamejam-ggj-2024-01d02b389d3ba302c84986295ec06839cf4d4918.tar.bz2 gamejam-ggj-2024-01d02b389d3ba302c84986295ec06839cf4d4918.zip |
Add instructions
-rwxr-xr-x | deploy.sh | 3 | ||||
-rw-r--r-- | game/instruction_popup.gd | 24 | ||||
-rw-r--r-- | game/instruction_resource.gd | 9 | ||||
-rw-r--r-- | game/main.gd | 5 | ||||
-rw-r--r-- | game/main.tscn | 254 | ||||
-rw-r--r-- | game/shared/tutorial/assets/Img_maos_trocadas.png (renamed from game/microgames/tutorial/assets/Img_maos_trocadas.png) | bin | 21987 -> 21987 bytes | |||
-rw-r--r-- | game/shared/tutorial/assets/Img_maos_trocadas.png.import (renamed from game/microgames/tutorial/assets/Img_maos_trocadas.png.import) | 6 | ||||
-rw-r--r-- | game/shared/tutorial/assets/Img_mindinho.png (renamed from game/microgames/tutorial/assets/Img_mindinho.png) | bin | 18383 -> 18383 bytes | |||
-rw-r--r-- | game/shared/tutorial/assets/Img_mindinho.png.import (renamed from game/microgames/tutorial/assets/Img_mindinho.png.import) | 6 | ||||
-rw-r--r-- | game/shared/tutorial/assets/Img_reverencia.png (renamed from game/microgames/tutorial/assets/Img_reverencia.png) | bin | 17367 -> 17367 bytes | |||
-rw-r--r-- | game/shared/tutorial/assets/Img_reverencia.png.import (renamed from game/microgames/tutorial/assets/Img_reverencia.png.import) | 6 | ||||
-rw-r--r-- | project.godot | 4 |
12 files changed, 306 insertions, 11 deletions
@@ -1,6 +1,7 @@ #! /bin/bash -readonly GODOT_4_PATH="/home/peronio/.local/bin/Godot_v4.2.1.x86_64" +#readonly GODOT_4_PATH="/home/peronio/.local/bin/Godot_v4.2.1.x86_64" +readonly GODOT_4_PATH="/Applications/Godot.app/Contents/MacOS/Godot" readonly PROJECT_NAME="ggj-2024" mkdir -p ./build/ diff --git a/game/instruction_popup.gd b/game/instruction_popup.gd new file mode 100644 index 0000000..8bcad5e --- /dev/null +++ b/game/instruction_popup.gd @@ -0,0 +1,24 @@ +class_name InstructionPopup +extends Control + +@export var instructions: Array[InstructionResource] + +func play_instruction(type: Microgame.MICROGAME_CONTROL): + var instruction: InstructionResource = get_instruction(type) + + %TextureZoeira.texture = instruction.texture_zoeira + %TextureInstruction.texture = instruction.texture_instruction + %LabelTitle.text = instruction.title + %Label1.text = instruction.label_1 + %Label2.text = instruction.label_2 + + $AnimationPlayer.play("start") + await $AnimationPlayer.animation_finished + + +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/instruction_resource.gd b/game/instruction_resource.gd new file mode 100644 index 0000000..639373d --- /dev/null +++ b/game/instruction_resource.gd @@ -0,0 +1,9 @@ +class_name InstructionResource +extends Resource + +@export var texture_zoeira: Texture2D +@export var texture_instruction: Texture2D +@export var type: Microgame.MICROGAME_CONTROL +@export var title = "" +@export var label_1 = "" +@export var label_2 = "" diff --git a/game/main.gd b/game/main.gd index ac05b48..e723c29 100644 --- a/game/main.gd +++ b/game/main.gd @@ -11,6 +11,7 @@ var MICROGAMES = [ @onready var microgame_viewport = %MicrogameViewport @onready var microgame_subviewport = %MicrogameSubViewport @onready var microgame_timer: Timer = %MicrogameTimer +@onready var instruction_popup: InstructionPopup = %InstructionPopup var _current_microgame: Microgame var _starting = true @@ -53,6 +54,10 @@ 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 + await transition.microgame_fade_in() _current_microgame.process_mode = Node.PROCESS_MODE_INHERIT diff --git a/game/main.tscn b/game/main.tscn index cc65b10..a553bf7 100644 --- a/game/main.tscn +++ b/game/main.tscn @@ -1,7 +1,12 @@ -[gd_scene load_steps=6 format=3 uid="uid://culqaacu08vye"] +[gd_scene load_steps=19 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"] +[ext_resource type="Script" path="res://game/instruction_popup.gd" id="3_lei0q"] +[ext_resource type="Script" path="res://game/instruction_resource.gd" id="4_30kv1"] +[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"] [sub_resource type="Animation" id="Animation_q2678"] length = 0.001 @@ -39,6 +44,172 @@ _data = { "fade_in": SubResource("Animation_krlic") } +[sub_resource type="Resource" id="Resource_o6d01"] +script = ExtResource("4_30kv1") +texture_zoeira = ExtResource("5_lhn6w") +texture_instruction = ExtResource("5_lhn6w") +type = 0 +title = "Head on Keyboard" +label_1 = "Touch any key with your forehead" +label_2 = "LIke doing a reverence to your love" + +[sub_resource type="Resource" id="Resource_sjq73"] +script = ExtResource("4_30kv1") +texture_zoeira = ExtResource("6_go5ee") +texture_instruction = ExtResource("6_go5ee") +type = 2 +title = "Only pinky" +label_1 = "Only press keys using your pinkies" +label_2 = "To strenghten the bond between you and your love" + +[sub_resource type="Resource" id="Resource_40y54"] +script = ExtResource("4_30kv1") +texture_zoeira = ExtResource("4_xg44k") +texture_instruction = ExtResource("4_xg44k") +type = 1 +title = "Inverted Hand" +label_1 = "Use the mouse with your non-dominant hand" +label_2 = "To train holding hands with your loved one" + +[sub_resource type="LabelSettings" id="LabelSettings_wskk0"] +font_size = 64 + +[sub_resource type="LabelSettings" id="LabelSettings_wx7qq"] +font_size = 32 + +[sub_resource type="Animation" id="Animation_s35sg"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:visible") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [false] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath(".:modulate") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 1, 1, 0)] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("%LabelTitle:modulate") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 1, 1, 0)] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("%Label1:modulate") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 1, 1, 0)] +} +tracks/4/type = "value" +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/path = NodePath("%Label2:modulate") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 1, 1, 0)] +} + +[sub_resource type="Animation" id="Animation_4nygo"] +resource_name = "start" +length = 10.0 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:visible") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 10), +"transitions": PackedFloat32Array(1, 1), +"update": 1, +"values": [true, false] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath(".:modulate") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 1, 9, 10), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("%LabelTitle:modulate") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(1, 2), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("%Label1:modulate") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(1, 3, 4), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 1, 1, 1)] +} +tracks/4/type = "value" +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/path = NodePath("%Label2:modulate") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/keys = { +"times": PackedFloat32Array(5, 6), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_ljsnm"] +_data = { +"RESET": SubResource("Animation_s35sg"), +"start": SubResource("Animation_4nygo") +} + [node name="Main" type="Node2D"] script = ExtResource("1_i86db") @@ -80,3 +251,84 @@ unique_name_in_owner = true libraries = { "": SubResource("AnimationLibrary_bnwsc") } + +[node name="InstructionLayer" type="CanvasLayer" parent="."] + +[node name="InstructionPopup" type="Control" parent="InstructionLayer"] +unique_name_in_owner = true +visible = false +modulate = Color(1, 1, 1, 0) +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +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"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(0.701961, 0.564706, 0.968627, 1) + +[node name="TextureZoeira" type="TextureRect" parent="InstructionLayer/InstructionPopup"] +unique_name_in_owner = true +layout_mode = 0 +offset_left = 28.0 +offset_top = 267.0 +offset_right = 399.0 +offset_bottom = 638.0 +texture = ExtResource("4_xg44k") + +[node name="TextureInstruction" type="TextureRect" parent="InstructionLayer/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("4_xg44k") + +[node name="LabelTitle" type="Label" parent="InstructionLayer/InstructionPopup"] +unique_name_in_owner = true +modulate = Color(1, 1, 1, 0) +layout_mode = 0 +offset_left = 76.0 +offset_top = 86.0 +offset_right = 539.0 +offset_bottom = 174.0 +text = "Replace Hands" +label_settings = SubResource("LabelSettings_wskk0") + +[node name="Label1" type="Label" parent="InstructionLayer/InstructionPopup"] +unique_name_in_owner = true +modulate = Color(1, 1, 1, 0) +layout_mode = 0 +offset_left = 419.0 +offset_top = 418.0 +offset_right = 1121.0 +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"] +unique_name_in_owner = true +modulate = Color(1, 1, 1, 0) +layout_mode = 0 +offset_left = 425.0 +offset_top = 475.0 +offset_right = 1127.0 +offset_bottom = 615.0 +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"] +libraries = { +"": SubResource("AnimationLibrary_ljsnm") +} diff --git a/game/microgames/tutorial/assets/Img_maos_trocadas.png b/game/shared/tutorial/assets/Img_maos_trocadas.png Binary files differindex c34d086..c34d086 100644 --- a/game/microgames/tutorial/assets/Img_maos_trocadas.png +++ b/game/shared/tutorial/assets/Img_maos_trocadas.png diff --git a/game/microgames/tutorial/assets/Img_maos_trocadas.png.import b/game/shared/tutorial/assets/Img_maos_trocadas.png.import index 90dfc18..6a6e2c5 100644 --- a/game/microgames/tutorial/assets/Img_maos_trocadas.png.import +++ b/game/shared/tutorial/assets/Img_maos_trocadas.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://dv4646lxakb8d" -path="res://.godot/imported/Img_maos_trocadas.png-f3567bfba72bd92c0095646db01b9d96.ctex" +path="res://.godot/imported/Img_maos_trocadas.png-63f8f95717b2d801c91ffad3f5d666fe.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://game/microgames/tutorial/assets/Img_maos_trocadas.png" -dest_files=["res://.godot/imported/Img_maos_trocadas.png-f3567bfba72bd92c0095646db01b9d96.ctex"] +source_file="res://game/shared/tutorial/assets/Img_maos_trocadas.png" +dest_files=["res://.godot/imported/Img_maos_trocadas.png-63f8f95717b2d801c91ffad3f5d666fe.ctex"] [params] diff --git a/game/microgames/tutorial/assets/Img_mindinho.png b/game/shared/tutorial/assets/Img_mindinho.png Binary files differindex 6d95852..6d95852 100644 --- a/game/microgames/tutorial/assets/Img_mindinho.png +++ b/game/shared/tutorial/assets/Img_mindinho.png diff --git a/game/microgames/tutorial/assets/Img_mindinho.png.import b/game/shared/tutorial/assets/Img_mindinho.png.import index 0f1b3fb..9baabd4 100644 --- a/game/microgames/tutorial/assets/Img_mindinho.png.import +++ b/game/shared/tutorial/assets/Img_mindinho.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://cxhuyyforfxwm" -path="res://.godot/imported/Img_mindinho.png-1a51041fcb89306f1c3af711bfe37f0d.ctex" +path="res://.godot/imported/Img_mindinho.png-d4d784174ba5768bbd627ab4feb3be93.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://game/microgames/tutorial/assets/Img_mindinho.png" -dest_files=["res://.godot/imported/Img_mindinho.png-1a51041fcb89306f1c3af711bfe37f0d.ctex"] +source_file="res://game/shared/tutorial/assets/Img_mindinho.png" +dest_files=["res://.godot/imported/Img_mindinho.png-d4d784174ba5768bbd627ab4feb3be93.ctex"] [params] diff --git a/game/microgames/tutorial/assets/Img_reverencia.png b/game/shared/tutorial/assets/Img_reverencia.png Binary files differindex 67b15d2..67b15d2 100644 --- a/game/microgames/tutorial/assets/Img_reverencia.png +++ b/game/shared/tutorial/assets/Img_reverencia.png diff --git a/game/microgames/tutorial/assets/Img_reverencia.png.import b/game/shared/tutorial/assets/Img_reverencia.png.import index 7e530da..3351d23 100644 --- a/game/microgames/tutorial/assets/Img_reverencia.png.import +++ b/game/shared/tutorial/assets/Img_reverencia.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://b81bbfen65gm3" -path="res://.godot/imported/Img_reverencia.png-b73804dbc11dd695e25389110803caf8.ctex" +path="res://.godot/imported/Img_reverencia.png-08e49a22cd588fe808ab8c284eca7ce1.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://game/microgames/tutorial/assets/Img_reverencia.png" -dest_files=["res://.godot/imported/Img_reverencia.png-b73804dbc11dd695e25389110803caf8.ctex"] +source_file="res://game/shared/tutorial/assets/Img_reverencia.png" +dest_files=["res://.godot/imported/Img_reverencia.png-08e49a22cd588fe808ab8c284eca7ce1.ctex"] [params] diff --git a/project.godot b/project.godot index 9ef6cbd..150d30c 100644 --- a/project.godot +++ b/project.godot @@ -13,6 +13,10 @@ config_version=5 run/main_scene="res://game/main.tscn" config/features=PackedStringArray("4.2") +[autoload] + +Session="*res://session.gd" + [display] window/stretch/mode="viewport" |