From 2910cfb515e54d90c2d9e934d1d38137bb77eb60 Mon Sep 17 00:00:00 2001 From: TechieDamien Date: Sat, 2 Aug 2025 14:44:22 +0100 Subject: [PATCH] Adds check for if the user is on mobile on the web to change the control instructions --- Scenes/main_menu.tscn | 6 ++++-- Scripts/instruction_label.gd | 21 +++++++++++++++++++++ Scripts/instruction_label.gd.uid | 1 + 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 Scripts/instruction_label.gd create mode 100644 Scripts/instruction_label.gd.uid diff --git a/Scenes/main_menu.tscn b/Scenes/main_menu.tscn index 07371c6..ae92f1b 100644 --- a/Scenes/main_menu.tscn +++ b/Scenes/main_menu.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=19 format=3 uid="uid://bu5cwjawsnb1q"] +[gd_scene load_steps=20 format=3 uid="uid://bu5cwjawsnb1q"] [ext_resource type="Script" uid="uid://bomw4j2mmerry" path="res://Scripts/main_menu.gd" id="1_28flt"] [ext_resource type="Texture2D" uid="uid://dxdtqv4do4x31" path="res://Sprites/background.png" id="2_48xlc"] [ext_resource type="Texture2D" uid="uid://c6kno4vjbvu28" path="res://Sprites/ouroboros.png" id="3_ce3w2"] [ext_resource type="Script" uid="uid://dp3dc6g76g8wq" path="res://Scripts/menu_ouroboros.gd" id="4_n45e2"] [ext_resource type="Texture2D" uid="uid://bbutodjdye61j" path="res://Sprites/cherry.png" id="5_trj04"] +[ext_resource type="Script" uid="uid://ctoqmgqe06xjw" path="res://Scripts/instruction_label.gd" id="5_vr1f0"] [ext_resource type="FontFile" uid="uid://cupgp2iqxdun5" path="res://Fonts/Kings-Regular.ttf" id="6_16hvj"] [ext_resource type="Texture2D" uid="uid://dr3y3mvyrecxn" path="res://Sprites/lemon.png" id="7_vr1f0"] [ext_resource type="Texture2D" uid="uid://csu4d06po6r6x" path="res://Sprites/apple.png" id="8_t1dhk"] @@ -201,7 +202,7 @@ grow_horizontal = 2 grow_vertical = 2 text = "A game of Ouroboros is about creating loops of snakes, called an Ouroboros. The aim is to create as many Ouroboroses as you can. -To control your snake, you can use, WASD, arrow keys or Vi direction keys. +To control your snake, you can use, WASD, arrow keys or Vi direction keys. (Swipe instead if you are on mobile) Eating a fruit does not give you any points, but will increase the length of your snake according the type of fruit as shown below. @@ -209,6 +210,7 @@ Eating a fruit does not give you any points, but will increase the length of you Each time you achieve an Ouroboros, you get one score and start as a new snake inside the old Ouroboros, making the arena smaller." label_settings = SubResource("LabelSettings_vtepg") autowrap_mode = 3 +script = ExtResource("5_vr1f0") [node name="FruitExamples" type="HBoxContainer" parent="HelpPanel"] layout_mode = 1 diff --git a/Scripts/instruction_label.gd b/Scripts/instruction_label.gd new file mode 100644 index 0000000..83c2c6e --- /dev/null +++ b/Scripts/instruction_label.gd @@ -0,0 +1,21 @@ +extends Label + +func _ready() -> void: + if OS.has_feature("web_android") or OS.has_feature("web_ios"): + text = "A game of Ouroboros is about creating loops of snakes, called an Ouroboros. The aim is to create as many Ouroboroses as you can. + +To control your snake, you can swipe in the direction you want to go. + +Eating a fruit does not give you any points, but will increase the length of your snake according the type of fruit as shown below. + + +Each time you achieve an Ouroboros, you get one score and start as a new snake inside the old Ouroboros, making the arena smaller." + else: + text = "A game of Ouroboros is about creating loops of snakes, called an Ouroboros. The aim is to create as many Ouroboroses as you can. + +To control your snake, you can use, WASD, arrow keys or Vi direction keys. + +Eating a fruit does not give you any points, but will increase the length of your snake according the type of fruit as shown below. + + +Each time you achieve an Ouroboros, you get one score and start as a new snake inside the old Ouroboros, making the arena smaller." diff --git a/Scripts/instruction_label.gd.uid b/Scripts/instruction_label.gd.uid new file mode 100644 index 0000000..b4de2a2 --- /dev/null +++ b/Scripts/instruction_label.gd.uid @@ -0,0 +1 @@ +uid://ctoqmgqe06xjw