From f612d173014a0a76fc027224ce6f619db49a7812 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Thu, 20 Aug 2020 14:45:54 +0200 Subject: [PATCH] Add control indicators (tips) --- images/Controls/PressA.png | Bin 0 -> 167 bytes images/Controls/PressA.png.import | 34 +++++++++++++++++++++ images/Controls/PressA.tres | 19 ++++++++++++ images/Controls/PressDown.png | Bin 0 -> 151 bytes images/Controls/PressDown.png.import | 34 +++++++++++++++++++++ images/Controls/PressDown.tres | 19 ++++++++++++ images/Controls/PressLeft.png | Bin 0 -> 154 bytes images/Controls/PressLeft.png.import | 34 +++++++++++++++++++++ images/Controls/PressLeft.tres | 19 ++++++++++++ images/Controls/PressRight.png | Bin 0 -> 150 bytes images/Controls/PressRight.png.import | 34 +++++++++++++++++++++ images/Controls/PressRight.tres | 19 ++++++++++++ images/Controls/PressSpace.png | Bin 0 -> 250 bytes images/Controls/PressSpace.png.import | 34 +++++++++++++++++++++ images/Controls/PressSpace.tres | 19 ++++++++++++ images/Controls/PressUp.png | Bin 0 -> 150 bytes images/Controls/PressUp.png.import | 34 +++++++++++++++++++++ images/Controls/PressUp.tres | 19 ++++++++++++ project.godot | 1 + scenes/dialogue.tscn | 7 ++++- scenes/game1.tscn | 16 +++++++++- scripts/ControlIndicator.gd | 41 ++++++++++++++++++++++++++ scripts/DialogueBox.gd | 7 +++++ scripts/Globals.gd | 3 ++ scripts/game1/ControlIndicators1.gd | 13 ++++++++ 25 files changed, 404 insertions(+), 2 deletions(-) create mode 100644 images/Controls/PressA.png create mode 100644 images/Controls/PressA.png.import create mode 100644 images/Controls/PressA.tres create mode 100644 images/Controls/PressDown.png create mode 100644 images/Controls/PressDown.png.import create mode 100644 images/Controls/PressDown.tres create mode 100644 images/Controls/PressLeft.png create mode 100644 images/Controls/PressLeft.png.import create mode 100644 images/Controls/PressLeft.tres create mode 100644 images/Controls/PressRight.png create mode 100644 images/Controls/PressRight.png.import create mode 100644 images/Controls/PressRight.tres create mode 100644 images/Controls/PressSpace.png create mode 100644 images/Controls/PressSpace.png.import create mode 100644 images/Controls/PressSpace.tres create mode 100644 images/Controls/PressUp.png create mode 100644 images/Controls/PressUp.png.import create mode 100644 images/Controls/PressUp.tres create mode 100644 scripts/ControlIndicator.gd create mode 100644 scripts/Globals.gd create mode 100644 scripts/game1/ControlIndicators1.gd diff --git a/images/Controls/PressA.png b/images/Controls/PressA.png new file mode 100644 index 0000000000000000000000000000000000000000..43477af3b9318f7cf193864f018bb95e7143b712 GIT binary patch literal 167 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~k!3HF)wbmE`DaPU;cPEB*=VV?2If5_rU1{CbvE&z{g$i4OxqtA@xGbB5H|#3i zPuM@bW2oSm?{IeWIfi)d1MZ#z*9(%Gg9`gKF6{gLx~B58vfTccCI6Xhi>w76amG#r PTE^h%>gTe~DWM4fLd7~< literal 0 HcmV?d00001 diff --git a/images/Controls/PressA.png.import b/images/Controls/PressA.png.import new file mode 100644 index 0000000..5ac797c --- /dev/null +++ b/images/Controls/PressA.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/PressA.png-e3ce1fae08387799463febc8df0536d3.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://images/Controls/PressA.png" +dest_files=[ "res://.import/PressA.png-e3ce1fae08387799463febc8df0536d3.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/images/Controls/PressA.tres b/images/Controls/PressA.tres new file mode 100644 index 0000000..410e77e --- /dev/null +++ b/images/Controls/PressA.tres @@ -0,0 +1,19 @@ +[gd_resource type="SpriteFrames" load_steps=4 format=2] + +[ext_resource path="res://images/Controls/PressA.png" type="Texture" id=1] + +[sub_resource type="AtlasTexture" id=1] +atlas = ExtResource( 1 ) +region = Rect2( 0, 0, 8, 9 ) + +[sub_resource type="AtlasTexture" id=2] +atlas = ExtResource( 1 ) +region = Rect2( 8, 0, 8, 9 ) + +[resource] +animations = [ { +"frames": [ SubResource( 1 ), SubResource( 2 ) ], +"loop": true, +"name": "default", +"speed": 2.0 +} ] diff --git a/images/Controls/PressDown.png b/images/Controls/PressDown.png new file mode 100644 index 0000000000000000000000000000000000000000..523c20c99033f2e820d590c3f1e97767f02311e3 GIT binary patch literal 151 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~k!3HF)wbmE`DaPU;cPEB*=VV?2If0%ojv*Qo zdnY;a9Z(QpI{4=QejoncV_^Z$U+`^G6Vh*LfA~k)<5T6N!=68Xoos%2DYo&H-zPI~ zN8?_P-oCQ1Z>&?7L~}*lFW>CCT;2b_!a4aXlT_IkeN(;*G@QZH)z4*}Q$iB}k2N;R literal 0 HcmV?d00001 diff --git a/images/Controls/PressDown.png.import b/images/Controls/PressDown.png.import new file mode 100644 index 0000000..ffa91f2 --- /dev/null +++ b/images/Controls/PressDown.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/PressDown.png-9c2b9a422d3d26e94891c5335e81a424.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://images/Controls/PressDown.png" +dest_files=[ "res://.import/PressDown.png-9c2b9a422d3d26e94891c5335e81a424.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/images/Controls/PressDown.tres b/images/Controls/PressDown.tres new file mode 100644 index 0000000..edf61a7 --- /dev/null +++ b/images/Controls/PressDown.tres @@ -0,0 +1,19 @@ +[gd_resource type="SpriteFrames" load_steps=4 format=2] + +[ext_resource path="res://images/Controls/PressDown.png" type="Texture" id=1] + +[sub_resource type="AtlasTexture" id=1] +atlas = ExtResource( 1 ) +region = Rect2( 0, 0, 8, 9 ) + +[sub_resource type="AtlasTexture" id=2] +atlas = ExtResource( 1 ) +region = Rect2( 8, 0, 8, 9 ) + +[resource] +animations = [ { +"frames": [ SubResource( 1 ), SubResource( 2 ) ], +"loop": true, +"name": "default", +"speed": 2.0 +} ] diff --git a/images/Controls/PressLeft.png b/images/Controls/PressLeft.png new file mode 100644 index 0000000000000000000000000000000000000000..5711e12491951fad48ff6ee54c47192d28e76d31 GIT binary patch literal 154 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~k!3HF)wbmE`DaPU;cPEB*=VV?2IU$}djv*Qo zTPIobF(`02uYC9~d|mUw9}6#dPMBuS5WVPW(~Ed!m16q_+r@wMe9BtFxL>$myts_p zuIb#5tRu}!G_QEcH*$6U^L`{6Cn~~~Ue5lhp2_gGlIQ|)i^)Lq89ZJ6T-G@yGywp6 C3o~8- literal 0 HcmV?d00001 diff --git a/images/Controls/PressLeft.png.import b/images/Controls/PressLeft.png.import new file mode 100644 index 0000000..b5cf460 --- /dev/null +++ b/images/Controls/PressLeft.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/PressLeft.png-1c3be7a4ee3f4d68565bc7d29c008652.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://images/Controls/PressLeft.png" +dest_files=[ "res://.import/PressLeft.png-1c3be7a4ee3f4d68565bc7d29c008652.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/images/Controls/PressLeft.tres b/images/Controls/PressLeft.tres new file mode 100644 index 0000000..6343ae5 --- /dev/null +++ b/images/Controls/PressLeft.tres @@ -0,0 +1,19 @@ +[gd_resource type="SpriteFrames" load_steps=4 format=2] + +[ext_resource path="res://images/Controls/PressLeft.png" type="Texture" id=1] + +[sub_resource type="AtlasTexture" id=1] +atlas = ExtResource( 1 ) +region = Rect2( 0, 0, 8, 9 ) + +[sub_resource type="AtlasTexture" id=2] +atlas = ExtResource( 1 ) +region = Rect2( 8, 0, 8, 9 ) + +[resource] +animations = [ { +"frames": [ SubResource( 1 ), SubResource( 2 ) ], +"loop": true, +"name": "default", +"speed": 2.0 +} ] diff --git a/images/Controls/PressRight.png b/images/Controls/PressRight.png new file mode 100644 index 0000000000000000000000000000000000000000..29b766ff59faa717054332586d1b3d7eda539dbf GIT binary patch literal 150 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~k!3HF)wbmE`DaPU;cPEB*=VV?2IRTz7jv*Qo zr%v+ZV^H8=Uit8U{5tmLPLJ4U9di#k-e?G8HjHOd$(BEGM&o|)jjm0XnYLwRPuY8B ydz19e6U7d5SI=NwpLDKr&R1==#C!i5Yu-;tk&$a$HiM_DpUXO@geCx}Tr{Qt literal 0 HcmV?d00001 diff --git a/images/Controls/PressRight.png.import b/images/Controls/PressRight.png.import new file mode 100644 index 0000000..6c38db1 --- /dev/null +++ b/images/Controls/PressRight.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/PressRight.png-a70738db6c03faf099a382ca479b5ebe.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://images/Controls/PressRight.png" +dest_files=[ "res://.import/PressRight.png-a70738db6c03faf099a382ca479b5ebe.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/images/Controls/PressRight.tres b/images/Controls/PressRight.tres new file mode 100644 index 0000000..42abd21 --- /dev/null +++ b/images/Controls/PressRight.tres @@ -0,0 +1,19 @@ +[gd_resource type="SpriteFrames" load_steps=4 format=2] + +[ext_resource path="res://images/Controls/PressRight.png" type="Texture" id=1] + +[sub_resource type="AtlasTexture" id=1] +atlas = ExtResource( 1 ) +region = Rect2( 0, 0, 8, 9 ) + +[sub_resource type="AtlasTexture" id=2] +atlas = ExtResource( 1 ) +region = Rect2( 8, 0, 8, 9 ) + +[resource] +animations = [ { +"frames": [ SubResource( 1 ), SubResource( 2 ) ], +"loop": true, +"name": "default", +"speed": 2.0 +} ] diff --git a/images/Controls/PressSpace.png b/images/Controls/PressSpace.png new file mode 100644 index 0000000000000000000000000000000000000000..b21da9eaffac46b34882835cce6dffdd7f69373a GIT binary patch literal 250 zcmVPx#v`IukR7i={R$CH)AP9uU`(K$pN@HjhA2r4P)GD%w+a%Kgp_t&W3s?mck%+|X zKQj}Zd-%ANS#TedF z2q?yCwAR}iyt$skd%{3ozE;fb3$R=_NH-fDmIoA5)3j?)4PJiFKsv^91QfGspj4a4 z+&;bd5%E>cp8S6|P~;m#LExWoxkty`0mZL>2fs@jx@}A;F8}}l07*qoM6N<$f`{E? AuK)l5 literal 0 HcmV?d00001 diff --git a/images/Controls/PressSpace.png.import b/images/Controls/PressSpace.png.import new file mode 100644 index 0000000..4f5e1c3 --- /dev/null +++ b/images/Controls/PressSpace.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/PressSpace.png-55d06e3dfa858bd419c0781f227612aa.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://images/Controls/PressSpace.png" +dest_files=[ "res://.import/PressSpace.png-55d06e3dfa858bd419c0781f227612aa.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/images/Controls/PressSpace.tres b/images/Controls/PressSpace.tres new file mode 100644 index 0000000..2f6ce85 --- /dev/null +++ b/images/Controls/PressSpace.tres @@ -0,0 +1,19 @@ +[gd_resource type="SpriteFrames" load_steps=4 format=2] + +[ext_resource path="res://images/Controls/PressSpace.png" type="Texture" id=1] + +[sub_resource type="AtlasTexture" id=1] +atlas = ExtResource( 1 ) +region = Rect2( 0, 0, 48, 9 ) + +[sub_resource type="AtlasTexture" id=2] +atlas = ExtResource( 1 ) +region = Rect2( 48, 0, 48, 9 ) + +[resource] +animations = [ { +"frames": [ SubResource( 1 ), SubResource( 2 ) ], +"loop": true, +"name": "default", +"speed": 2.0 +} ] diff --git a/images/Controls/PressUp.png b/images/Controls/PressUp.png new file mode 100644 index 0000000000000000000000000000000000000000..ea26632434166a51c8168de5ad69f4ea0e9845a2 GIT binary patch literal 150 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~k!3HF)wbmE`DaPU;cPEB*=VV?2IRTz7jv*Qo zdnX*^V^H95TKe<8bav2ZIiWGq{^4@pVi{ xn3MGN-H&+=tZ$@O*jn3^hn#S3)2mr)$M|cRm~t%hAvd7e44$rjF6*2UngDb DialogueAction: var dialogue = DialogueAction.new() @@ -122,11 +125,15 @@ func update() -> void: func animate_text(): var animated = index text_label.visible_characters = 0 + control_indicator.hide() while animated == index && text_label.visible_characters < text_label.text.length(): if text_label.text[text_label.visible_characters] == ' ': text_label.visible_characters += 1 text_label.visible_characters += 1 yield(get_tree().create_timer(0.4 if text_label.text[text_label.visible_characters - 1] == '.' else 0.05), 'timeout') + if !Globals.ui_accept_tip: + control_indicator.show_press('ui_accept') + Globals.ui_accept_tip = true func stop_waiting(): waiting = false diff --git a/scripts/Globals.gd b/scripts/Globals.gd new file mode 100644 index 0000000..2c05a00 --- /dev/null +++ b/scripts/Globals.gd @@ -0,0 +1,3 @@ +extends Node + +var ui_accept_tip = false diff --git a/scripts/game1/ControlIndicators1.gd b/scripts/game1/ControlIndicators1.gd new file mode 100644 index 0000000..13eb8b2 --- /dev/null +++ b/scripts/game1/ControlIndicators1.gd @@ -0,0 +1,13 @@ +extends Node2D + + +func _ready(): + $ControlIndicatorLeft.show_press('left') + $ControlIndicatorRight.show_press('right') + +func _input(event): + if !get_parent().get_node("Player").sleep: + if event.is_action_pressed('left'): + $ControlIndicatorLeft.hide() + if event.is_action_pressed('right'): + $ControlIndicatorRight.hide()