From 9b890c6bd2964f524a9101ef5dcca853ff40e4b9 Mon Sep 17 00:00:00 2001 From: Fabio Date: Mon, 19 Aug 2024 22:02:43 +0200 Subject: [PATCH 1/5] add level completed screen --- gmtk_2024/Winds 7.ttf | Bin 118342 -> 0 bytes gmtk_2024/Winds 7.ttf.import | 34 ------------ gmtk_2024/levels/LevelBase.tscn | 2 +- gmtk_2024/levels/Level_1_Rooms/level_1_2.tscn | 34 ++++++------ gmtk_2024/levels/level_1.tscn | 14 ++--- gmtk_2024/objects/LevelComplete.tscn | 49 ++++++++++++++++++ gmtk_2024/scripts/goal.gd | 8 ++- gmtk_2024/scripts/menu_credit_control.gd | 9 ++-- 8 files changed, 85 insertions(+), 65 deletions(-) delete mode 100644 gmtk_2024/Winds 7.ttf delete mode 100644 gmtk_2024/Winds 7.ttf.import create mode 100644 gmtk_2024/objects/LevelComplete.tscn diff --git a/gmtk_2024/Winds 7.ttf b/gmtk_2024/Winds 7.ttf deleted file mode 100644 index a49900e9ece05ac1c84deb1353b6f309ca595eff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 118342 zcmeHw572E_b=Nxgy(BM9NT37>B&Ht_%fA!?2?R+rhZ0RFlmGz&g_2}QAgKv?O+ZtJ z*3;TioT8Izt4yVpDvW7C42tDXQI0J-=)lNW22mON1{uW>N35W<^W^h)_Flhr?_THb zyU+RV`Tj)DeRJQsYwfkyUhB8k{&UW~-@Q_a$T`x;F}eJ@n_hA~xJs(KE(Seu<4wkRe^F6nny!n^k@FbBl&lNfA!nfZ26K{Fe8}I%dk;lAOs@Gh3=N-4* z{`xx}{t|RQh3E6{gy4+Du}kp!TX_f1 z_y_K}?SYfkRq__JUkLr3x7~Kn9slEs8?Tn?Eng5>JpJUo_rG24k}IUT^K{n^PoXMu z^5d`k(Ob^H=G(9Vfyg_b{=9Fj(nXY?kVWVb`W%y8s4N=%*DQjh>%m9$hdWLDf4e*( z$e`jLi|QAu2jvVozJOVgU0CTTo>$1{I^F0?_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!O*k(VE$-rn^@2ku?q}-`=`*>Z@L_Mi@bzjbt-I{GHo&rYU`$p#bS4I_?n`+5fLck;j*xq=e20F29rT(*qY!XMf`Q}MXAks z7a<%Ddiegw)YI6zuZ<3c2;;Tru)k9n6k|5~+Tdd)&zO5v(#DwCP7JLdF{z^-Kh2BP zA)rFu_wzF%Y6CDl0%oJ6e~z=HgY3}`SB}m0 zuwFD6H@<(d)<18rhv(8itaW%dL@?s&`yq+d)hZ$acAnDA8sB-=i+PrQCCD zuTVMlNLjB$fpSl&N4vHnIJ>=-DtOf)`+1g&6`Kzxn zSRB`(VCXfm-Ohc=Tf6q_wX0qhO-4%!N5b48?`f`GR<5x?7=sR$m{N^X2FC z^%-)G{F1&t6IT!)(AQ_<^#?KUtK(-wa-MudUw3|fT3>g5eqLX9e*SxX-TC?Z`Wk*# z=j&_uSzRPI%U$v|xn1s;9l1(gC3nbMAn^{?}L@Q|*> z@T2i!S7VBf5e=xZ=0nv0y6?L0y6?L0y6?L0y6?L0y6?L z0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L z0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L z0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L0y6?L d0y6?L0y6?L0y6?L0y6?L0y6?L0uvzce*ts?UMc_p diff --git a/gmtk_2024/Winds 7.ttf.import b/gmtk_2024/Winds 7.ttf.import deleted file mode 100644 index 13b2a24..0000000 --- a/gmtk_2024/Winds 7.ttf.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="font_data_dynamic" -type="FontFile" -uid="uid://b1m5vkvhmf1x8" -path="res://.godot/imported/Winds 7.ttf-d65fb42952f9ffdf099366b21f03c274.fontdata" - -[deps] - -source_file="res://Winds 7.ttf" -dest_files=["res://.godot/imported/Winds 7.ttf-d65fb42952f9ffdf099366b21f03c274.fontdata"] - -[params] - -Rendering=null -antialiasing=1 -generate_mipmaps=false -disable_embedded_bitmaps=true -multichannel_signed_distance_field=false -msdf_pixel_range=8 -msdf_size=48 -allow_system_fallback=true -force_autohinter=false -hinting=1 -subpixel_positioning=1 -oversampling=0.0 -Fallbacks=null -fallbacks=[] -Compress=null -compress=true -preload=[] -language_support={} -script_support={} -opentype_features={} diff --git a/gmtk_2024/levels/LevelBase.tscn b/gmtk_2024/levels/LevelBase.tscn index 7b852c1..0134827 100644 --- a/gmtk_2024/levels/LevelBase.tscn +++ b/gmtk_2024/levels/LevelBase.tscn @@ -3,7 +3,7 @@ [ext_resource type="PackedScene" uid="uid://snxpqx0ony7s" path="res://objects/Player.tscn" id="1_prjlb"] [ext_resource type="PackedScene" uid="uid://dii1q3f5dj72y" path="res://objects/CRT.tscn" id="2_mxtem"] [ext_resource type="Shader" path="res://shaders/scrolling.gdshader" id="3_lcf1n"] -[ext_resource type="Texture2D" uid="uid://bu3jvq8ho4rpf" path="res://textures/Level 01.png" id="4_p3e10"] +[ext_resource type="Texture2D" uid="uid://bn7cejgxkah8o" path="res://textures/Level 01.png" id="4_p3e10"] [ext_resource type="Texture2D" uid="uid://c3m4os8kteaix" path="res://textures/level01-spritesheet.png" id="5_wr4v5"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_4uh45"] diff --git a/gmtk_2024/levels/Level_1_Rooms/level_1_2.tscn b/gmtk_2024/levels/Level_1_Rooms/level_1_2.tscn index b4670a4..3926600 100644 --- a/gmtk_2024/levels/Level_1_Rooms/level_1_2.tscn +++ b/gmtk_2024/levels/Level_1_Rooms/level_1_2.tscn @@ -1,13 +1,14 @@ -[gd_scene load_steps=12 format=4 uid="uid://bgrwqfa7lr66a"] +[gd_scene load_steps=13 format=4 uid="uid://bgrwqfa7lr66a"] [ext_resource type="PackedScene" uid="uid://ba6afuig8bqrg" path="res://levels/LevelBase.tscn" id="1_hxt4x"] [ext_resource type="Texture2D" uid="uid://c3m4os8kteaix" path="res://textures/level01-spritesheet.png" id="2_3aspe"] [ext_resource type="Shader" path="res://shaders/scrolling.gdshader" id="3_kfccg"] -[ext_resource type="Texture2D" uid="uid://bu3jvq8ho4rpf" path="res://textures/Level 01.png" id="4_eh1te"] +[ext_resource type="Texture2D" uid="uid://bn7cejgxkah8o" path="res://textures/Level 01.png" id="4_eh1te"] [ext_resource type="PackedScene" uid="uid://d0q0sfati8wk0" path="res://objects/ResizableBlock.tscn" id="5_g32pt"] [ext_resource type="PackedScene" uid="uid://c168bkledwyya" path="res://objects/Laser.tscn" id="6_kbfc1"] [ext_resource type="PackedScene" uid="uid://c6g2f7tm7iasr" path="res://objects/PressurePlate.tscn" id="7_5joy3"] [ext_resource type="PackedScene" uid="uid://d0gpnqknarkg7" path="res://objects/Goal.tscn" id="8_sbr7w"] +[ext_resource type="PackedScene" uid="uid://bvvxwhg4tihng" path="res://menu/level_menu/level_select.tscn" id="9_0dfbn"] [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_a4gjk"] texture = ExtResource("2_3aspe") @@ -126,22 +127,10 @@ shader_parameter/scroll_speed = 0.02 [node name="LevelBase" instance=ExtResource("1_hxt4x")] -[node name="Player" parent="." index="0"] +[node name="Player" parent="." index="1"] position = Vector2(-254, 99) input_pickable = true -[node name="Walls" parent="." index="3"] -collision_mask = 22 - -[node name="Ceiling" parent="Walls" index="0"] -position = Vector2(57, -171) - -[node name="LeftWall" parent="Walls" index="1"] -position = Vector2(-320, 26) - -[node name="RightWall" parent="Walls" index="2"] -position = Vector2(338, 15) - [node name="Layer1" type="TileMapLayer" parent="." index="4"] use_parent_material = true tile_map_data = PackedByteArray("AAD2//v/AAADAAAAAAD2//z/AAACAAEAAAD2//3/AAABAAEAAAD2//7/AAACAAEAAAD2////AAACAAEAAAD2/wAAAAADAAIAAAD2/wEAAAADAAAAAAD2/wIAAAACAAEAAAD2/wMAAAACAAEAAAD2/wQAAAADAAIAAAAJAPv/AAAFAAAAAAAJAP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3/AAAIAAEAAFD+//3/AAACAAAAAAAAAP//AAABAAIAAAD/////AAAAAAIAAAD///7/AAAHAAAAAAAAAP7/AAACAAAAAAABAP//AAAIAAAAAVD+//7/AAAAAAIAAAAFAAEAAAAAAAAAAAAFAAIAAAAAAAEAAAACAAMAAAABAAAAAAADAAMAAAABAAAAAAAEAAMAAAABAAAAAAAFAAMAAAAFAAIAAAAGAAMAAAABAAEAAAAHAAMAAAABAAEAAAAIAAMAAAABAAEAAAAGAAEAAAABAAAAAAAHAAEAAAABAAAAAAAIAAEAAAABAAAAAAD3/wEAAAABAAIAAAD4/wEAAAABAAIAAAD5/wEAAAABAAIAAAAGAAIAAAABAAEAAAAHAAIAAAABAAEAAAAIAAIAAAABAAEAAAD6/wEAAAACAAIAAAA=") @@ -185,6 +174,19 @@ rotation = 1.57987 [node name="Goal" parent="." index="12" instance=ExtResource("8_sbr7w")] position = Vector2(-272, -112) +next = ExtResource("9_0dfbn") -[node name="Layer0" parent="." index="14"] +[node name="Walls" parent="." index="13"] +collision_mask = 22 + +[node name="Ceiling" parent="Walls" index="0"] +position = Vector2(57, -171) + +[node name="LeftWall" parent="Walls" index="1"] +position = Vector2(-320, 26) + +[node name="RightWall" parent="Walls" index="2"] +position = Vector2(338, 15) + +[node name="Layer0" parent="." index="15"] visible = false diff --git a/gmtk_2024/levels/level_1.tscn b/gmtk_2024/levels/level_1.tscn index 24c85d1..6d86264 100644 --- a/gmtk_2024/levels/level_1.tscn +++ b/gmtk_2024/levels/level_1.tscn @@ -7,11 +7,15 @@ [node name="LevelBase" instance=ExtResource("1_87xn7")] -[node name="Player" parent="." index="0"] +[node name="Player" parent="." index="1"] position = Vector2(-254, 99) input_pickable = true -[node name="Walls" parent="." index="3"] +[node name="Goal" parent="." index="4" instance=ExtResource("9_xut5w")] +position = Vector2(-272, -112) +next = ExtResource("3_usr81") + +[node name="Walls" parent="." index="5"] collision_mask = 22 [node name="Ceiling" parent="Walls" index="0"] @@ -23,11 +27,7 @@ position = Vector2(-320, 26) [node name="RightWall" parent="Walls" index="2"] position = Vector2(338, 15) -[node name="Goal" parent="." index="4" instance=ExtResource("9_xut5w")] -position = Vector2(-272, -112) -next = ExtResource("3_usr81") - -[node name="Layer0" parent="." index="6"] +[node name="Layer0" parent="." index="7"] tile_map_data = PackedByteArray("AAD2//v/AAADAAAAAAD2//z/AAACAAEAAAD2//3/AAADAAIAAAD2//7/AAABAAEAAAD2////AAABAAEAAAD2/wAAAAABAAEAAAD2/wEAAAADAAAAAAD2/wIAAAACAAEAAAD2/wMAAAACAAEAAAD2/wQAAAADAAIAAAAJAPv/AAAFAAAAAAAJAPz/AAAAAAEAAAAJAP3/AAAAAAEAAAAJAP7/AAAAAAEAAAAJAP//AAAAAAEAAAAJAAAAAAAAAAEAAAAJAAEAAAAAAAEAAAAJAAIAAAAAAAEAAAAJAAMAAAAAAAEAAAAJAAQAAAAFAAIAAAD3//v/AAABAAIAAAD4//v/AAABAAIAAAD5//v/AAABAAIAAAD6//v/AAABAAIAAAD7//v/AAABAAIAAAD8//v/AAABAAIAAAD9//v/AAABAAIAAAD+//v/AAABAAIAAAD///v/AAABAAIAAAAAAPv/AAABAAIAAAABAPv/AAABAAIAAAACAPv/AAABAAIAAAADAPv/AAABAAIAAAAEAPv/AAABAAIAAAAFAPv/AAABAAIAAAAGAPv/AAABAAIAAAAHAPv/AAABAAIAAAAIAPv/AAABAAIAAAD3/wQAAAABAAAAAAD4/wQAAAABAAAAAAD5/wQAAAABAAAAAAD6/wQAAAABAAAAAAD7/wQAAAABAAAAAAD8/wQAAAABAAAAAAD9/wQAAAABAAAAAAD+/wQAAAABAAAAAAD//wQAAAABAAAAAAAAAAQAAAABAAAAAAABAAQAAAABAAAAAAACAAQAAAABAAAAAAADAAQAAAABAAAAAAAEAAQAAAABAAAAAAAFAAQAAAABAAAAAAAGAAQAAAABAAAAAAAHAAQAAAABAAAAAAAIAAQAAAABAAAAAAABAAEAAAAAAAIAAAACAAEAAAACAAIAAAD3////AAABAAEAAAD4////AAACAAEAAAD4/wAAAAACAAEAAAD3/wAAAAABAAEAAAD3/wEAAAABAAIAAAD4/wEAAAACAAIAAAD3//7/AAABAAEAAAD4//7/AAACAAEAAAD3//3/AAABAAAAAAD4//3/AAACAAAAAAABAAAAAAAAAAAAAAACAAAAAAACAAAAAAA=") [node name="AnimatableBody2D" parent="." index="8" instance=ExtResource("5_4ggcc")] diff --git a/gmtk_2024/objects/LevelComplete.tscn b/gmtk_2024/objects/LevelComplete.tscn new file mode 100644 index 0000000..49b7e80 --- /dev/null +++ b/gmtk_2024/objects/LevelComplete.tscn @@ -0,0 +1,49 @@ +[gd_scene load_steps=5 format=3 uid="uid://n2culjgg5aji"] + +[ext_resource type="Theme" uid="uid://cohbys634cf18" path="res://menu/main_menu/MainMenuTheme.tres" id="1_tm23e"] +[ext_resource type="PackedScene" uid="uid://dii1q3f5dj72y" path="res://objects/CRT.tscn" id="2_d3r0j"] +[ext_resource type="Script" path="res://scripts/menu_credit_control.gd" id="3_hokr0"] +[ext_resource type="FontFile" uid="uid://d3pbvdemdbxes" path="res://CommodoreSixtyFour.ttf" id="4_8fqei"] + +[node name="LevelComplete" type="MarginContainer"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_tm23e") + +[node name="CanvasLayer" parent="." instance=ExtResource("2_d3r0j")] + +[node name="ColorRect" type="ColorRect" parent="."] +layout_mode = 2 +color = Color(0, 0, 0, 1) + +[node name="Control" type="Control" parent="."] +layout_mode = 2 +script = ExtResource("3_hokr0") + +[node name="VBoxContainer" type="VBoxContainer" parent="Control"] +layout_mode = 0 +offset_right = 40.0 +offset_bottom = 40.0 + +[node name="Label" type="Label" parent="Control/VBoxContainer"] +layout_mode = 2 + +[node name="BackToMenu" type="HBoxContainer" parent="Control/VBoxContainer"] +visible = false +layout_mode = 2 + +[node name="Label" type="Label" parent="Control/VBoxContainer/BackToMenu"] +custom_minimum_size = Vector2(8, 0) +layout_mode = 2 +theme_override_fonts/font = ExtResource("4_8fqei") +text = ">" + +[node name="back" type="Button" parent="Control/VBoxContainer/BackToMenu"] +layout_mode = 2 +text = "back to level menu" +flat = true + +[connection signal="pressed" from="Control/VBoxContainer/BackToMenu/back" to="Control" method="_return_to_main_menu"] diff --git a/gmtk_2024/scripts/goal.gd b/gmtk_2024/scripts/goal.gd index 0b16d55..1a3ef57 100644 --- a/gmtk_2024/scripts/goal.gd +++ b/gmtk_2024/scripts/goal.gd @@ -1,11 +1,17 @@ extends Node @export var next : PackedScene +@export var completed = preload("res://objects/LevelComplete.tscn") @onready var animation = $AnimationPlayer +@onready var level_select_scene = preload("res://menu/level_menu/level_select.tscn") + func _process(delta: float) -> void: animation.play("portal") func _on_body_entered(body: Node2D) -> void: - get_tree().change_scene_to_packed(next) + if next == level_select_scene: + get_tree().change_scene_to_packed(completed) + else: + get_tree().change_scene_to_packed(next) diff --git a/gmtk_2024/scripts/menu_credit_control.gd b/gmtk_2024/scripts/menu_credit_control.gd index 380cb32..5dd6199 100644 --- a/gmtk_2024/scripts/menu_credit_control.gd +++ b/gmtk_2024/scripts/menu_credit_control.gd @@ -1,11 +1,8 @@ extends Control var credits_text = """ -CREDITS: ------------ -Programming: Jannis, Fabio -Design: Leon -Music: TBN +SECTOR COMPLETED + """ var current_text = "" @@ -52,7 +49,7 @@ func _show_menu_options() -> void: $VBoxContainer/BackToMenu.visible = true func _return_to_main_menu() -> void: - get_tree().change_scene_to_file("res://menu/main_menu/MainMenu.tscn") + get_tree().change_scene_to_file("res://menu/level_menu/level_select.tscn") func _show_full_text() -> void: current_text = credits_text From 033718351eb427162e865b8008394f0e8abdfdfc Mon Sep 17 00:00:00 2001 From: Fabio Date: Tue, 20 Aug 2024 00:41:10 +0200 Subject: [PATCH 2/5] changed menu navigation --- gmtk_2024/menu/main_menu/Cre73AB.tmp | 49 +++++++++++++ gmtk_2024/objects/LevelComplete.tscn | 4 +- gmtk_2024/project.godot | 16 +++++ gmtk_2024/scripts/level_completed_control.gd | 66 ++++++++++++++++++ gmtk_2024/scripts/level_select.gd | 1 + gmtk_2024/scripts/menu_credit_control.gd | 72 ++++++++++++++----- gmtk_2024/scripts/menu_main_control.gd | 73 ++++++++++++++++---- 7 files changed, 248 insertions(+), 33 deletions(-) create mode 100644 gmtk_2024/menu/main_menu/Cre73AB.tmp create mode 100644 gmtk_2024/scripts/level_completed_control.gd diff --git a/gmtk_2024/menu/main_menu/Cre73AB.tmp b/gmtk_2024/menu/main_menu/Cre73AB.tmp new file mode 100644 index 0000000..d5e1d8f --- /dev/null +++ b/gmtk_2024/menu/main_menu/Cre73AB.tmp @@ -0,0 +1,49 @@ +[gd_scene load_steps=5 format=3 uid="uid://cut2xjnvh8i58"] + +[ext_resource type="Theme" uid="uid://cohbys634cf18" path="res://menu/main_menu/MainMenuTheme.tres" id="1_tmf11"] +[ext_resource type="Script" path="res://scripts/menu_credit_control.gd" id="2_ogwi7"] +[ext_resource type="PackedScene" uid="uid://dii1q3f5dj72y" path="res://objects/CRT.tscn" id="3_rybt6"] +[ext_resource type="FontFile" uid="uid://d3pbvdemdbxes" path="res://CommodoreSixtyFour.ttf" id="4_pv7fe"] + +[node name="CreditScene" type="MarginContainer"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_tmf11") + +[node name="CanvasLayer" parent="." instance=ExtResource("3_rybt6")] + +[node name="ColorRect" type="ColorRect" parent="."] +layout_mode = 2 +color = Color(0, 0, 0, 1) + +[node name="Control" type="Control" parent="."] +layout_mode = 2 +script = ExtResource("2_ogwi7") + +[node name="VBoxContainer" type="VBoxContainer" parent="Control"] +layout_mode = 0 +offset_right = 40.0 +offset_bottom = 40.0 + +[node name="Label" type="Label" parent="Control/VBoxContainer"] +layout_mode = 2 + +[node name="BackToMenu" type="HBoxContainer" parent="Control/VBoxContainer"] +visible = false +layout_mode = 2 + +[node name="Label" type="Label" parent="Control/VBoxContainer/BackToMenu"] +custom_minimum_size = Vector2(8, 0) +layout_mode = 2 +theme_override_fonts/font = ExtResource("4_pv7fe") +text = ">" + +[node name="back" type="Button" parent="Control/VBoxContainer/BackToMenu"] +layout_mode = 2 +text = "back to menu" +flat = true + +[connection signal="pressed" from="Control/VBoxContainer/BackToMenu/back" to="Control" method="_return_to_main_menu"] diff --git a/gmtk_2024/objects/LevelComplete.tscn b/gmtk_2024/objects/LevelComplete.tscn index 49b7e80..222ca8b 100644 --- a/gmtk_2024/objects/LevelComplete.tscn +++ b/gmtk_2024/objects/LevelComplete.tscn @@ -2,7 +2,7 @@ [ext_resource type="Theme" uid="uid://cohbys634cf18" path="res://menu/main_menu/MainMenuTheme.tres" id="1_tm23e"] [ext_resource type="PackedScene" uid="uid://dii1q3f5dj72y" path="res://objects/CRT.tscn" id="2_d3r0j"] -[ext_resource type="Script" path="res://scripts/menu_credit_control.gd" id="3_hokr0"] +[ext_resource type="Script" path="res://scripts/level_completed_control.gd" id="3_38v2l"] [ext_resource type="FontFile" uid="uid://d3pbvdemdbxes" path="res://CommodoreSixtyFour.ttf" id="4_8fqei"] [node name="LevelComplete" type="MarginContainer"] @@ -21,7 +21,7 @@ color = Color(0, 0, 0, 1) [node name="Control" type="Control" parent="."] layout_mode = 2 -script = ExtResource("3_hokr0") +script = ExtResource("3_38v2l") [node name="VBoxContainer" type="VBoxContainer" parent="Control"] layout_mode = 0 diff --git a/gmtk_2024/project.godot b/gmtk_2024/project.godot index 3ccd342..69d8341 100644 --- a/gmtk_2024/project.godot +++ b/gmtk_2024/project.godot @@ -55,6 +55,22 @@ r={ "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":82,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) ] } +up={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +down={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +accept={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194309,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} [layer_names] diff --git a/gmtk_2024/scripts/level_completed_control.gd b/gmtk_2024/scripts/level_completed_control.gd new file mode 100644 index 0000000..5dc2cc7 --- /dev/null +++ b/gmtk_2024/scripts/level_completed_control.gd @@ -0,0 +1,66 @@ +extends Control + +var credits_text = """ +CONGRATULATIONS +THIS SECTOR IS NOW INFECTED +YOU NOW HAVE ACCESS TO THE NEXT SECTION + +""" + +var current_text = "" +var char_index = 0 +var typing_speed = 0.05 # Normale Tippgeschwindigkeit +var fast_typing_speed = 0.01 # Schnellere Tippgeschwindigkeit +var is_fast_typing = false # Statusvariable für schnelleres Tippen + +# Zum Überprüfen eines Doppelklicks +var last_click_time = 0.0 +var double_click_time = 0.3 # Zeitfenster für Doppelklick in Sekunden + +func _ready(): + _start_typing() + +func _process(_delta: float) -> void: + # Überprüfe, ob eine Taste oder Maustaste gedrückt gehalten wird + if Input.is_action_pressed("ui_accept") or Input.is_action_pressed("ui_accept"): + if get_time_since_last_click() <= double_click_time: + _show_full_text() + else: + is_fast_typing = true + else: + is_fast_typing = false + + typing_speed = fast_typing_speed if is_fast_typing else 0.05 + +func _start_typing() -> void: + current_text = "" + char_index = 0 + _update_text() + +func _update_text() -> void: + if char_index < credits_text.length(): + current_text += credits_text[char_index] + $VBoxContainer/Label.text = current_text + char_index += 1 + await get_tree().create_timer(typing_speed).timeout + _update_text() + else: + _show_menu_options() + +func _show_menu_options() -> void: + $VBoxContainer/BackToMenu.visible = true + +func _return_to_main_menu() -> void: + get_tree().change_scene_to_file("res://menu/level_menu/level_select.tscn") + +func _show_full_text() -> void: + current_text = credits_text + $VBoxContainer/Label.text = current_text + char_index = credits_text.length() + _show_menu_options() + +func get_time_since_last_click() -> float: + var current_time = Time.get_ticks_msec() / 1000.0 # Zeit in Sekunden + var time_since_last_click = current_time - last_click_time + last_click_time = current_time + return time_since_last_click diff --git a/gmtk_2024/scripts/level_select.gd b/gmtk_2024/scripts/level_select.gd index 33fdbf8..69248b8 100644 --- a/gmtk_2024/scripts/level_select.gd +++ b/gmtk_2024/scripts/level_select.gd @@ -1,6 +1,7 @@ extends Control func _ready(): + Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) setup_level_box() connect_level_selected_to_level_box() diff --git a/gmtk_2024/scripts/menu_credit_control.gd b/gmtk_2024/scripts/menu_credit_control.gd index 5dd6199..ceef505 100644 --- a/gmtk_2024/scripts/menu_credit_control.gd +++ b/gmtk_2024/scripts/menu_credit_control.gd @@ -1,38 +1,72 @@ extends Control var credits_text = """ -SECTOR COMPLETED +CREDITS: +----------- +Programming: Jannis, Fabio +Pixel Art : Leon +Music: TBN """ var current_text = "" var char_index = 0 -var typing_speed = 0.05 # Normale Tippgeschwindigkeit -var fast_typing_speed = 0.01 # Schnellere Tippgeschwindigkeit -var is_fast_typing = false # Statusvariable für schnelleres Tippen - -# Zum Überprüfen eines Doppelklicks +var typing_speed = 0.05 +var fast_typing_speed = 0.0001 var last_click_time = 0.0 -var double_click_time = 0.3 # Zeitfenster für Doppelklick in Sekunden +var double_click_time = 0.3 +var is_typing = true +var current_button_index = 0 +var button func _ready(): + _initialize_menu() _start_typing() -func _process(_delta: float) -> void: - # Überprüfe, ob eine Taste oder Maustaste gedrückt gehalten wird - if Input.is_action_pressed("ui_accept") or Input.is_action_pressed("ui_accept"): - if get_time_since_last_click() <= double_click_time: - _show_full_text() - else: - is_fast_typing = true - else: - is_fast_typing = false +func _initialize_menu(): + button = $VBoxContainer/BackToMenu + _update_button_visibility() + _blink_current_button() - typing_speed = fast_typing_speed if is_fast_typing else 0.05 +func _update_button_visibility(): + var hbox_container = button + var label_node = hbox_container.get_child(0) + if label_node != null: + label_node.visible + +func _process(_delta: float) -> void: + if not is_typing: + if Input.is_action_pressed("ui_accept"): + typing_speed = fast_typing_speed + +func _blink_current_button() -> void: + while true: + var hbox_container = button + var label_node = hbox_container.get_child(0) + if label_node != null: + label_node.visible = true + await get_tree().create_timer(0.5).timeout + if label_node != null: + label_node.visible = false + await get_tree().create_timer(0.5).timeout + +func _unhandled_input(event: InputEvent) -> void: + if is_typing: + if event is InputEventKey and event.is_pressed(): + if get_time_since_last_click() <= double_click_time: + _show_full_text() + else: + typing_speed = fast_typing_speed + elif event is InputEventKey and not event.is_pressed(): + typing_speed = 0.05 + else: + if event.is_action_pressed("ui_accept"): + button.get_child(1).emit_signal("pressed") func _start_typing() -> void: current_text = "" char_index = 0 + is_typing = true _update_text() func _update_text() -> void: @@ -43,18 +77,20 @@ func _update_text() -> void: await get_tree().create_timer(typing_speed).timeout _update_text() else: + is_typing = false _show_menu_options() func _show_menu_options() -> void: $VBoxContainer/BackToMenu.visible = true func _return_to_main_menu() -> void: - get_tree().change_scene_to_file("res://menu/level_menu/level_select.tscn") + get_tree().change_scene_to_file("res://menu/main_menu/MainMenu.tscn") func _show_full_text() -> void: current_text = credits_text $VBoxContainer/Label.text = current_text char_index = credits_text.length() + is_typing = false _show_menu_options() func get_time_since_last_click() -> float: diff --git a/gmtk_2024/scripts/menu_main_control.gd b/gmtk_2024/scripts/menu_main_control.gd index fdfdbe6..0bbd4f4 100644 --- a/gmtk_2024/scripts/menu_main_control.gd +++ b/gmtk_2024/scripts/menu_main_control.gd @@ -1,16 +1,16 @@ extends Control var display_text = """ -SYSTEM INITIALIZATION... +STARTING Infiltrate.exe ... --------------------------------------- -PLACEHOLDER GAME NAME BOOT SEQUENCE -COPYRIGHT PLACEHOLDER MADE FOR GMTK GAME JAM 2024 ->> WARNING: ->> RECOMMENDED ACTION: +>> SECURITY PROTOCOLS: ACTIVE +>> SCANNING FOR THREATS... + +>> WARNING: UNAUTHORIZED ACCESS DETECTED +>> INITIALIZING COUNTERMEASURES... -SYSTEM READY. PRESS START TO GET ACCESS. """ @@ -21,26 +21,71 @@ var typing_speed = 0.05 var fast_typing_speed = 0.0001 var last_click_time = 0.0 var double_click_time = 0.3 +var is_typing = true +var current_button_index = 0 +var buttons = [] func _ready(): for hbox in $VBoxContainer/Buttons.get_children(): hbox.visible = false + Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN) + _initialize_menu() _start_typing() +func _initialize_menu(): + buttons = $VBoxContainer/Buttons.get_children() + _update_button_visibility() + _blink_current_button() + +func _update_button_visibility(): + for i in range(len(buttons)): + var hbox_container = buttons[i] + var label_node = hbox_container.get_child(0) + if label_node != null: + label_node.visible = (i == current_button_index) + +func _blink_current_button() -> void: + while true: + var hbox_container = buttons[current_button_index] + var label_node = hbox_container.get_child(0) + if label_node != null: + label_node.visible = true + await get_tree().create_timer(0.5).timeout + if label_node != null: + label_node.visible = false + await get_tree().create_timer(0.5).timeout + + func _unhandled_input(event: InputEvent) -> void: - if event.is_action_pressed("ui_accept") or event is InputEventMouseButton: - if get_time_since_last_click() <= double_click_time: - _show_full_text() - else: - typing_speed = fast_typing_speed + if is_typing: + if event is InputEventKey and event.is_pressed(): + if get_time_since_last_click() <= double_click_time: + _show_full_text() + else: + typing_speed = fast_typing_speed + elif event is InputEventKey and not event.is_pressed(): + typing_speed = 0.05 + else: + if event.is_action_pressed("ui_down") or event.is_action_pressed("down"): + current_button_index = (current_button_index + 1) % buttons.size() + _update_button_visibility() + elif event.is_action_pressed("ui_up") or event.is_action_pressed("up"): + current_button_index = (current_button_index - 1 + buttons.size()) % buttons.size() + _update_button_visibility() + elif event.is_action_pressed("ui_accept"): + buttons[current_button_index].get_child(1).emit_signal("pressed") + func _process(_delta: float) -> void: - typing_speed = 0.05 # Zurück zur normalen Geschwindigkeit + if not is_typing: + if Input.is_action_pressed("ui_accept"): + typing_speed = fast_typing_speed func _start_typing() -> void: current_text = "" char_index = 0 + is_typing = true _update_text() func _update_text() -> void: @@ -51,6 +96,7 @@ func _update_text() -> void: await get_tree().create_timer(typing_speed).timeout _update_text() else: + is_typing = false _show_menu_options() func _show_menu_options() -> void: @@ -61,6 +107,7 @@ func _show_full_text() -> void: current_text = display_text $VBoxContainer/VBoxContainer2/Label.text = current_text char_index = display_text.length() + is_typing = false _show_menu_options() func get_time_since_last_click() -> float: @@ -76,6 +123,6 @@ func _on_credits_button_pressed() -> void: get_tree().change_scene_to_file("res://menu/main_menu/CreditsScene.tscn") func _on_quit_button_pressed() -> void: - $VBoxContainer/VBoxContainer2/Label.text += "\nLogging out!" + $VBoxContainer/VBoxContainer2/Label.text += "Logging out!" await get_tree().create_timer(0.5).timeout get_tree().quit() From 9d43b070afc54d2c548cf417b91be49b893c6076 Mon Sep 17 00:00:00 2001 From: Fabio Date: Tue, 20 Aug 2024 04:52:54 +0200 Subject: [PATCH 3/5] pause menu WIP --- gmtk_2024/levels/LevelBase.tscn | 11 +- gmtk_2024/menu/PauseMenu.tscn | 87 ++++++++++++++++ gmtk_2024/menu/main_menu/MainMenu.tscn | 26 ++++- gmtk_2024/project.godot | 5 + gmtk_2024/scripts/menu_main_control.gd | 5 +- gmtk_2024/scripts/pause_menu_control.gd | 130 ++++++++++++++++++++++++ gmtk_2024/scripts/player_movement.gd | 2 +- 7 files changed, 258 insertions(+), 8 deletions(-) create mode 100644 gmtk_2024/menu/PauseMenu.tscn create mode 100644 gmtk_2024/scripts/pause_menu_control.gd diff --git a/gmtk_2024/levels/LevelBase.tscn b/gmtk_2024/levels/LevelBase.tscn index 0134827..dd98367 100644 --- a/gmtk_2024/levels/LevelBase.tscn +++ b/gmtk_2024/levels/LevelBase.tscn @@ -1,5 +1,6 @@ -[gd_scene load_steps=13 format=4 uid="uid://ba6afuig8bqrg"] +[gd_scene load_steps=14 format=4 uid="uid://ba6afuig8bqrg"] +[ext_resource type="PackedScene" uid="uid://s683ua4q2ewm" path="res://menu/PauseMenu.tscn" id="1_dtdta"] [ext_resource type="PackedScene" uid="uid://snxpqx0ony7s" path="res://objects/Player.tscn" id="1_prjlb"] [ext_resource type="PackedScene" uid="uid://dii1q3f5dj72y" path="res://objects/CRT.tscn" id="2_mxtem"] [ext_resource type="Shader" path="res://shaders/scrolling.gdshader" id="3_lcf1n"] @@ -138,6 +139,7 @@ size = Vector2(1289, 70.5) [node name="Player" parent="." instance=ExtResource("1_prjlb")] [node name="CanvasLayer" parent="." instance=ExtResource("2_mxtem")] +visible = false [node name="Camera2D" type="Camera2D" parent="."] @@ -183,3 +185,10 @@ collision_mask = 4 [node name="Ground" type="CollisionShape2D" parent="Ground"] position = Vector2(10, 375) shape = SubResource("RectangleShape2D_1vofj") + +[node name="PauseMenu" parent="." instance=ExtResource("1_dtdta")] +visible = false +offset_left = -320.0 +offset_top = -160.0 +offset_right = -320.0 +offset_bottom = -160.0 diff --git a/gmtk_2024/menu/PauseMenu.tscn b/gmtk_2024/menu/PauseMenu.tscn new file mode 100644 index 0000000..2389ff7 --- /dev/null +++ b/gmtk_2024/menu/PauseMenu.tscn @@ -0,0 +1,87 @@ +[gd_scene load_steps=5 format=3 uid="uid://s683ua4q2ewm"] + +[ext_resource type="Theme" uid="uid://cohbys634cf18" path="res://menu/main_menu/MainMenuTheme.tres" id="1_fna2g"] +[ext_resource type="PackedScene" uid="uid://dii1q3f5dj72y" path="res://objects/CRT.tscn" id="2_vaod1"] +[ext_resource type="Script" path="res://scripts/pause_menu_control.gd" id="3_tyr11"] +[ext_resource type="FontFile" uid="uid://d3pbvdemdbxes" path="res://CommodoreSixtyFour.ttf" id="4_u4plf"] + +[node name="PauseMenu" type="MarginContainer"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_fna2g") + +[node name="CanvasLayer" parent="." instance=ExtResource("2_vaod1")] + +[node name="ColorRect" type="ColorRect" parent="."] +layout_mode = 2 +color = Color(0, 0, 0, 1) + +[node name="Control" type="Control" parent="."] +layout_mode = 2 +script = ExtResource("3_tyr11") + +[node name="VBoxContainer" type="VBoxContainer" parent="Control"] +layout_mode = 0 +offset_right = 40.0 +offset_bottom = 40.0 + +[node name="VBoxContainer2" type="VBoxContainer" parent="Control/VBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="Control/VBoxContainer/VBoxContainer2"] +layout_mode = 2 + +[node name="Buttons" type="VBoxContainer" parent="Control/VBoxContainer"] +layout_mode = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="Control/VBoxContainer/Buttons"] +visible = false +layout_mode = 2 + +[node name="Label" type="Label" parent="Control/VBoxContainer/Buttons/HBoxContainer"] +custom_minimum_size = Vector2(8, 0) +layout_mode = 2 +theme_override_fonts/font = ExtResource("4_u4plf") +text = ">" + +[node name="continue" type="Button" parent="Control/VBoxContainer/Buttons/HBoxContainer"] +layout_mode = 2 +text = "continue" +flat = true + +[node name="HBoxContainer2" type="HBoxContainer" parent="Control/VBoxContainer/Buttons"] +visible = false +layout_mode = 2 + +[node name="Label" type="Label" parent="Control/VBoxContainer/Buttons/HBoxContainer2"] +custom_minimum_size = Vector2(8, 0) +layout_mode = 2 +theme_override_fonts/font = ExtResource("4_u4plf") +text = ">" + +[node name="restart" type="Button" parent="Control/VBoxContainer/Buttons/HBoxContainer2"] +layout_mode = 2 +text = "restart" +flat = true + +[node name="HBoxContainer3" type="HBoxContainer" parent="Control/VBoxContainer/Buttons"] +visible = false +layout_mode = 2 + +[node name="Label" type="Label" parent="Control/VBoxContainer/Buttons/HBoxContainer3"] +custom_minimum_size = Vector2(8, 0) +layout_mode = 2 +theme_override_fonts/font = ExtResource("4_u4plf") +text = ">" + +[node name="main menu" type="Button" parent="Control/VBoxContainer/Buttons/HBoxContainer3"] +layout_mode = 2 +text = "main menu" +flat = true + +[connection signal="pressed" from="Control/VBoxContainer/Buttons/HBoxContainer/continue" to="Control" method="_on_continue_button_pressed"] +[connection signal="pressed" from="Control/VBoxContainer/Buttons/HBoxContainer2/restart" to="Control" method="_on_restart_button_pressed"] +[connection signal="pressed" from="Control/VBoxContainer/Buttons/HBoxContainer3/main menu" to="Control" method="_on_back_to_main_menu_button_pressed"] diff --git a/gmtk_2024/menu/main_menu/MainMenu.tscn b/gmtk_2024/menu/main_menu/MainMenu.tscn index 5e206f6..d3b1026 100644 --- a/gmtk_2024/menu/main_menu/MainMenu.tscn +++ b/gmtk_2024/menu/main_menu/MainMenu.tscn @@ -62,9 +62,9 @@ layout_mode = 2 theme_override_fonts/font = ExtResource("1_1tx2i") text = ">" -[node name="credits" type="Button" parent="Control/VBoxContainer/Buttons/HBoxContainer2"] +[node name="level_select" type="Button" parent="Control/VBoxContainer/Buttons/HBoxContainer2"] layout_mode = 2 -text = "credits" +text = "level selection" flat = true [node name="HBoxContainer3" type="HBoxContainer" parent="Control/VBoxContainer/Buttons"] @@ -77,11 +77,27 @@ layout_mode = 2 theme_override_fonts/font = ExtResource("1_1tx2i") text = ">" -[node name="quit" type="Button" parent="Control/VBoxContainer/Buttons/HBoxContainer3"] +[node name="credits" type="Button" parent="Control/VBoxContainer/Buttons/HBoxContainer3"] +layout_mode = 2 +text = "credits" +flat = true + +[node name="HBoxContainer4" type="HBoxContainer" parent="Control/VBoxContainer/Buttons"] +visible = false +layout_mode = 2 + +[node name="Label" type="Label" parent="Control/VBoxContainer/Buttons/HBoxContainer4"] +custom_minimum_size = Vector2(8, 0) +layout_mode = 2 +theme_override_fonts/font = ExtResource("1_1tx2i") +text = ">" + +[node name="quit" type="Button" parent="Control/VBoxContainer/Buttons/HBoxContainer4"] layout_mode = 2 text = "quit" flat = true [connection signal="pressed" from="Control/VBoxContainer/Buttons/HBoxContainer/start" to="Control" method="_on_start_button_pressed"] -[connection signal="pressed" from="Control/VBoxContainer/Buttons/HBoxContainer2/credits" to="Control" method="_on_credits_button_pressed"] -[connection signal="pressed" from="Control/VBoxContainer/Buttons/HBoxContainer3/quit" to="Control" method="_on_quit_button_pressed"] +[connection signal="pressed" from="Control/VBoxContainer/Buttons/HBoxContainer2/level_select" to="Control" method="_on_level_select_pressed"] +[connection signal="pressed" from="Control/VBoxContainer/Buttons/HBoxContainer3/credits" to="Control" method="_on_credits_button_pressed"] +[connection signal="pressed" from="Control/VBoxContainer/Buttons/HBoxContainer4/quit" to="Control" method="_on_quit_button_pressed"] diff --git a/gmtk_2024/project.godot b/gmtk_2024/project.godot index 69d8341..9c03d1e 100644 --- a/gmtk_2024/project.godot +++ b/gmtk_2024/project.godot @@ -71,6 +71,11 @@ accept={ , Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194309,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) ] } +pause={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} [layer_names] diff --git a/gmtk_2024/scripts/menu_main_control.gd b/gmtk_2024/scripts/menu_main_control.gd index 0bbd4f4..f986b20 100644 --- a/gmtk_2024/scripts/menu_main_control.gd +++ b/gmtk_2024/scripts/menu_main_control.gd @@ -2,8 +2,8 @@ extends Control var display_text = """ STARTING Infiltrate.exe ... ---------------------------------------- MADE FOR GMTK GAME JAM 2024 +--------------------------------------- >> SECURITY PROTOCOLS: ACTIVE >> SCANNING FOR THREATS... @@ -118,6 +118,9 @@ func get_time_since_last_click() -> float: func _on_start_button_pressed() -> void: get_tree().change_scene_to_file("res://menu/level_menu/level_select.tscn") + +func _on_level_select_pressed(): + get_tree().change_scene_to_file("res://menu/level_menu/level_select.tscn") func _on_credits_button_pressed() -> void: get_tree().change_scene_to_file("res://menu/main_menu/CreditsScene.tscn") diff --git a/gmtk_2024/scripts/pause_menu_control.gd b/gmtk_2024/scripts/pause_menu_control.gd new file mode 100644 index 0000000..f083c75 --- /dev/null +++ b/gmtk_2024/scripts/pause_menu_control.gd @@ -0,0 +1,130 @@ +extends Control + +var display_text = """ +PAUSING OPERATION ... +--------------------------------------- +""" + +signal continue_game +signal restart_game +signal back_to_main_menu + +var current_text = "" +var char_index = 0 +var typing_speed = 0.05 +var fast_typing_speed = 0.0001 +var last_click_time = 0.0 +var double_click_time = 0.3 +var is_typing = true +var current_button_index = 0 +var buttons = [] +var current_scene = null +var pause_menu_node = null + +func _ready(): + current_scene = get_tree().current_scene + + # Referenz auf das übergeordnete Pausenmenü + pause_menu_node = get_parent() + + for hbox in $VBoxContainer/Buttons.get_children(): + hbox.visible = false + + Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN) + _initialize_menu() + _start_typing() + +func _initialize_menu(): + buttons = $VBoxContainer/Buttons.get_children() + _update_button_visibility() + +func _update_button_visibility(): + for i in range(len(buttons)): + var hbox_container = buttons[i] + var label_node = hbox_container.get_child(0) + if label_node != null: + label_node.visible = (i == current_button_index) + +func _unhandled_input(event: InputEvent) -> void: + if is_typing: + if event is InputEventKey and event.is_pressed(): + if get_time_since_last_click() <= double_click_time: + _show_full_text() + else: + typing_speed = fast_typing_speed + elif event is InputEventKey and not event.is_pressed(): + typing_speed = 0.05 + else: + if event.is_action_pressed("pause"): + toggle_pause_menu() + + # Navigation mit den Pfeiltasten + if event.is_action_pressed("ui_down"): + navigate_menu(1) + elif event.is_action_pressed("ui_up"): + navigate_menu(-1) + + # Bestätigen mit der Leertaste oder Enter + if event.is_action_pressed("ui_accept"): + buttons[current_button_index].get_child(1).emit_signal("pressed") + +func _process(_delta: float) -> void: + if not is_typing and Input.is_action_pressed("ui_accept"): + typing_speed = fast_typing_speed + +func _start_typing() -> void: + current_text = "" + char_index = 0 + is_typing = true + _update_text() + +func _update_text() -> void: + if char_index < display_text.length(): + current_text += display_text[char_index] + $VBoxContainer/VBoxContainer2/Label.text = current_text + char_index += 1 + await get_tree().create_timer(typing_speed).timeout + _update_text() + else: + is_typing = false + _show_menu_options() + +func _show_menu_options() -> void: + for hbox in $VBoxContainer/Buttons.get_children(): + hbox.visible = true + grab_focus() # Menü erhält den Fokus, um Eingaben zu empfangen + +func _show_full_text() -> void: + current_text = display_text + $VBoxContainer/VBoxContainer2/Label.text = current_text + char_index = display_text.length() + is_typing = false + _show_menu_options() + +func get_time_since_last_click() -> float: + var current_time = Time.get_ticks_msec() / 1000.0 # Zeit in Sekunden + var time_since_last_click = current_time - last_click_time + last_click_time = current_time + return time_since_last_click + +func toggle_pause_menu(): + if pause_menu_node.visible: + _on_continue_button_pressed() + else: + pause_menu_node.visible = true + get_tree().paused = true + grab_focus() # Menü erhält den Fokus, um Eingaben zu empfangen + +func _on_continue_button_pressed(): + pause_menu_node.visible = false + get_tree().paused = false + +func _on_restart_button_pressed(): + emit_signal("restart_game") + +func _on_back_to_main_menu_button_pressed(): + emit_signal("back_to_main_menu") + +func navigate_menu(direction: int) -> void: + current_button_index = (current_button_index + direction + buttons.size()) % buttons.size() + _update_button_visibility() diff --git a/gmtk_2024/scripts/player_movement.gd b/gmtk_2024/scripts/player_movement.gd index a669bc1..dcfa3e8 100644 --- a/gmtk_2024/scripts/player_movement.gd +++ b/gmtk_2024/scripts/player_movement.gd @@ -27,7 +27,7 @@ var cursor_scale_down = preload("res://textures/cursor_scale_down.png") func _ready(): data_link = $data_link -func _unhandled_input(event): +func _unhandled_input(event: InputEvent) -> void: if event.is_action_pressed("click"): var nearest_block = find_nearest_block() if nearest_block: From 29c30a10de3ca882fa4cc5bb3ff6278e4e1af2f0 Mon Sep 17 00:00:00 2001 From: Booklordofthedings Date: Tue, 20 Aug 2024 11:25:54 +0200 Subject: [PATCH 4/5] Fix layouting --- gmtk_2024/project.godot | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gmtk_2024/project.godot b/gmtk_2024/project.godot index 9c03d1e..d2702f4 100644 --- a/gmtk_2024/project.godot +++ b/gmtk_2024/project.godot @@ -10,17 +10,18 @@ config_version=5 [application] -config/name="GMTK_2024" +config/name="Infiltration.exe" run/main_scene="res://menu/main_menu/MainMenu.tscn" config/features=PackedStringArray("4.3", "GL Compatibility") -config/icon="res://icon.svg" +config/icon="res://temp_assets/icon.svg" [display] -window/size/viewport_width=640 -window/size/viewport_height=320 +window/size/viewport_width=1280 +window/size/viewport_height=720 window/size/mode=2 window/stretch/mode="viewport" +window/stretch/scale=2.0 mouse_cursor/custom_image="res://textures/cursor_normal.png" [input] From d3d63402b8f64435eb2ea5bde2a45d61dc8e014b Mon Sep 17 00:00:00 2001 From: Fabio Date: Tue, 20 Aug 2024 16:02:39 +0200 Subject: [PATCH 5/5] get change screen working --- gmtk_2024/objects/LevA5DE.tmp | 49 +++++++++++++++ gmtk_2024/project.godot | 3 +- gmtk_2024/scripts/level_completed_control.gd | 63 +++++++++++++++----- gmtk_2024/scripts/menu_main_control.gd | 2 +- gmtk_2024/scripts/pause_menu_control.gd | 15 ++--- 5 files changed, 105 insertions(+), 27 deletions(-) create mode 100644 gmtk_2024/objects/LevA5DE.tmp diff --git a/gmtk_2024/objects/LevA5DE.tmp b/gmtk_2024/objects/LevA5DE.tmp new file mode 100644 index 0000000..222ca8b --- /dev/null +++ b/gmtk_2024/objects/LevA5DE.tmp @@ -0,0 +1,49 @@ +[gd_scene load_steps=5 format=3 uid="uid://n2culjgg5aji"] + +[ext_resource type="Theme" uid="uid://cohbys634cf18" path="res://menu/main_menu/MainMenuTheme.tres" id="1_tm23e"] +[ext_resource type="PackedScene" uid="uid://dii1q3f5dj72y" path="res://objects/CRT.tscn" id="2_d3r0j"] +[ext_resource type="Script" path="res://scripts/level_completed_control.gd" id="3_38v2l"] +[ext_resource type="FontFile" uid="uid://d3pbvdemdbxes" path="res://CommodoreSixtyFour.ttf" id="4_8fqei"] + +[node name="LevelComplete" type="MarginContainer"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_tm23e") + +[node name="CanvasLayer" parent="." instance=ExtResource("2_d3r0j")] + +[node name="ColorRect" type="ColorRect" parent="."] +layout_mode = 2 +color = Color(0, 0, 0, 1) + +[node name="Control" type="Control" parent="."] +layout_mode = 2 +script = ExtResource("3_38v2l") + +[node name="VBoxContainer" type="VBoxContainer" parent="Control"] +layout_mode = 0 +offset_right = 40.0 +offset_bottom = 40.0 + +[node name="Label" type="Label" parent="Control/VBoxContainer"] +layout_mode = 2 + +[node name="BackToMenu" type="HBoxContainer" parent="Control/VBoxContainer"] +visible = false +layout_mode = 2 + +[node name="Label" type="Label" parent="Control/VBoxContainer/BackToMenu"] +custom_minimum_size = Vector2(8, 0) +layout_mode = 2 +theme_override_fonts/font = ExtResource("4_8fqei") +text = ">" + +[node name="back" type="Button" parent="Control/VBoxContainer/BackToMenu"] +layout_mode = 2 +text = "back to level menu" +flat = true + +[connection signal="pressed" from="Control/VBoxContainer/BackToMenu/back" to="Control" method="_return_to_main_menu"] diff --git a/gmtk_2024/project.godot b/gmtk_2024/project.godot index 9c03d1e..62ecb8c 100644 --- a/gmtk_2024/project.godot +++ b/gmtk_2024/project.godot @@ -37,7 +37,8 @@ player_left={ } player_jump={ "deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null) +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null) ] } click={ diff --git a/gmtk_2024/scripts/level_completed_control.gd b/gmtk_2024/scripts/level_completed_control.gd index 5dc2cc7..74afc12 100644 --- a/gmtk_2024/scripts/level_completed_control.gd +++ b/gmtk_2024/scripts/level_completed_control.gd @@ -9,32 +9,62 @@ YOU NOW HAVE ACCESS TO THE NEXT SECTION var current_text = "" var char_index = 0 -var typing_speed = 0.05 # Normale Tippgeschwindigkeit -var fast_typing_speed = 0.01 # Schnellere Tippgeschwindigkeit -var is_fast_typing = false # Statusvariable für schnelleres Tippen - -# Zum Überprüfen eines Doppelklicks +var typing_speed = 0.05 +var fast_typing_speed = 0.0001 var last_click_time = 0.0 -var double_click_time = 0.3 # Zeitfenster für Doppelklick in Sekunden +var double_click_time = 0.3 +var is_typing = true +var current_button_index = 0 +var button func _ready(): + _initialize_menu() _start_typing() -func _process(_delta: float) -> void: - # Überprüfe, ob eine Taste oder Maustaste gedrückt gehalten wird - if Input.is_action_pressed("ui_accept") or Input.is_action_pressed("ui_accept"): - if get_time_since_last_click() <= double_click_time: - _show_full_text() - else: - is_fast_typing = true - else: - is_fast_typing = false +func _initialize_menu(): + button = $VBoxContainer/BackToMenu + _update_button_visibility() + _blink_current_button() - typing_speed = fast_typing_speed if is_fast_typing else 0.05 +func _update_button_visibility(): + var hbox_container = button + var label_node = hbox_container.get_child(0) + if label_node != null: + label_node.visible + +func _process(_delta: float) -> void: + if not is_typing: + if Input.is_action_pressed("ui_accept"): + typing_speed = fast_typing_speed + +func _blink_current_button() -> void: + while true: + var hbox_container = button + var label_node = hbox_container.get_child(0) + if label_node != null: + label_node.visible = true + await get_tree().create_timer(0.5).timeout + if label_node != null: + label_node.visible = false + await get_tree().create_timer(0.5).timeout + +func _unhandled_input(event: InputEvent) -> void: + if is_typing: + if event is InputEventKey and event.is_pressed(): + if get_time_since_last_click() <= double_click_time: + _show_full_text() + else: + typing_speed = fast_typing_speed + elif event is InputEventKey and not event.is_pressed(): + typing_speed = 0.05 + else: + if event.is_action_pressed("ui_accept"): + button.get_child(1).emit_signal("pressed") func _start_typing() -> void: current_text = "" char_index = 0 + is_typing = true _update_text() func _update_text() -> void: @@ -45,6 +75,7 @@ func _update_text() -> void: await get_tree().create_timer(typing_speed).timeout _update_text() else: + is_typing = false _show_menu_options() func _show_menu_options() -> void: diff --git a/gmtk_2024/scripts/menu_main_control.gd b/gmtk_2024/scripts/menu_main_control.gd index f986b20..88df569 100644 --- a/gmtk_2024/scripts/menu_main_control.gd +++ b/gmtk_2024/scripts/menu_main_control.gd @@ -117,7 +117,7 @@ func get_time_since_last_click() -> float: return time_since_last_click func _on_start_button_pressed() -> void: - get_tree().change_scene_to_file("res://menu/level_menu/level_select.tscn") + get_tree().change_scene_to_file("res://levels/level_1.tscn") func _on_level_select_pressed(): get_tree().change_scene_to_file("res://menu/level_menu/level_select.tscn") diff --git a/gmtk_2024/scripts/pause_menu_control.gd b/gmtk_2024/scripts/pause_menu_control.gd index f083c75..b1df443 100644 --- a/gmtk_2024/scripts/pause_menu_control.gd +++ b/gmtk_2024/scripts/pause_menu_control.gd @@ -24,7 +24,6 @@ var pause_menu_node = null func _ready(): current_scene = get_tree().current_scene - # Referenz auf das übergeordnete Pausenmenü pause_menu_node = get_parent() for hbox in $VBoxContainer/Buttons.get_children(): @@ -54,17 +53,15 @@ func _unhandled_input(event: InputEvent) -> void: typing_speed = fast_typing_speed elif event is InputEventKey and not event.is_pressed(): typing_speed = 0.05 - else: - if event.is_action_pressed("pause"): - toggle_pause_menu() + #else: + #if event.is_action_pressed("pause"): + #toggle_pause_menu() - # Navigation mit den Pfeiltasten if event.is_action_pressed("ui_down"): navigate_menu(1) elif event.is_action_pressed("ui_up"): navigate_menu(-1) - # Bestätigen mit der Leertaste oder Enter if event.is_action_pressed("ui_accept"): buttons[current_button_index].get_child(1).emit_signal("pressed") @@ -92,7 +89,7 @@ func _update_text() -> void: func _show_menu_options() -> void: for hbox in $VBoxContainer/Buttons.get_children(): hbox.visible = true - grab_focus() # Menü erhält den Fokus, um Eingaben zu empfangen + grab_focus() func _show_full_text() -> void: current_text = display_text @@ -102,7 +99,7 @@ func _show_full_text() -> void: _show_menu_options() func get_time_since_last_click() -> float: - var current_time = Time.get_ticks_msec() / 1000.0 # Zeit in Sekunden + var current_time = Time.get_ticks_msec() / 1000.0 var time_since_last_click = current_time - last_click_time last_click_time = current_time return time_since_last_click @@ -113,7 +110,7 @@ func toggle_pause_menu(): else: pause_menu_node.visible = true get_tree().paused = true - grab_focus() # Menü erhält den Fokus, um Eingaben zu empfangen + grab_focus() func _on_continue_button_pressed(): pause_menu_node.visible = false