Touch Controls

This commit is contained in:
Page Asgardius 2024-12-01 18:45:44 -07:00
parent a064871ba5
commit eaad1e7e64
27 changed files with 60 additions and 25 deletions

View file

@ -1,3 +1,3 @@
source_md5="51780c8bf5283cb0a6fbf57946224f4d"
dest_md5="1952a0401f4be037d1ae3c3d004bc7fe"
source_md5="84c7e776a616d97d2a7f692398135015"
dest_md5="acfb108c68e655014c4dc876553ebd7b"

View file

@ -1,3 +1,3 @@
source_md5="2fe4d318ce0e70b28fb5b47482fb548c"
dest_md5="cbf912993b6c7cb951c016ab13116c9c"
source_md5="7479ae174d458d969279072c36e0d511"
dest_md5="e1291d4fba26a5310be50977f56921f0"

View file

@ -1,3 +1,3 @@
source_md5="7836b4b121d4bfc06e1dcba0fbf30e0c"
dest_md5="89d90b0632d0d8a163348ac538a49405"
source_md5="51c96b6ea47fb7927f530094caf35adc"
dest_md5="d9f32baee2dbd67925a0d749622d4d8f"

View file

@ -1,3 +1,3 @@
source_md5="5930f0392b60dcebff2cf6a0b95a8c36"
dest_md5="dc02d55149313fa54c77defa27eaf72d"
source_md5="caf7f492b490fdf64931bb2aedbc8032"
dest_md5="5696f05ce60a3de5a5f51cf1823b5c03"

View file

@ -27,7 +27,7 @@ func _input(event):
gamepadtest.new(event)
updatehud()
# Mouse in viewport coordinates.
if Input.is_action_just_pressed("ui_accept"):
if Input.is_action_just_pressed("ui_accept") || Input.is_action_just_pressed("mclick"):
#print("Mouse Click/Unclick at: ", event.position)
get_tree().change_scene("res://title.tscn")
#_title()

View file

@ -15,5 +15,5 @@ func _process(delta: float) -> void:
pass
func _input(event):
if Input.is_action_just_pressed("ui_accept"):
if Input.is_action_just_pressed("ui_accept") || Input.is_action_just_pressed("mclick"):
get_tree().change_scene("res://title.tscn")

View file

@ -32,7 +32,7 @@ func _process(delta):
func _input(event):
updatehud()
# Mouse in viewport coordinates.
if Input.is_action_just_pressed("ui_accept"):
if Input.is_action_just_pressed("ui_accept") || Input.is_action_just_pressed("mclick"):
#print("Mouse Click/Unclick at: ", event.position)
_title()

View file

@ -24,7 +24,7 @@ func _process(delta):
func _input(event):
updatehud()
# Mouse in viewport coordinates.
if Input.is_action_just_pressed("ui_accept"):
if Input.is_action_just_pressed("ui_accept") || Input.is_action_just_pressed("mclick"):
#print("Mouse Click/Unclick at: ", event.position)
_title()

View file

@ -49,10 +49,11 @@ var owlocation = [[null, null], [null, null]]
const musictracks = ["res://music/midorinoyume.ogg", "res://music/seahorse.ogg", "res://music/chinesegoat.ogg", "res://music/doyoufeelold.ogg", "res://music/doyiuneedahealer.ogg", "res://music/adayatceres.ogg", "res://music/twintroublemakers.ogg", "res://music/easyquiz.ogg", "res://music/neowave.ogg", "res://music/multivectorsubmarines.ogg", "res://music/halfgeniegirls.ogg", "res://music/rusianmaverickfairy.ogg", "res://music/blacksmithofdestruction.ogg", "res://music/shininglikefireworks.ogg", "res://music/sadtrashcan.ogg", "res://music/akikonotegami.ogg", "res://music/asadcat.ogg", "res://music/lilydesire.ogg", "res://music/scholartrip.ogg", "res://music/quantumice.ogg", "res://music/unreeeal.ogg", "res://music/alsa.ogg", "res://music/silverblue.ogg"]
const sfxtracks = ["res://sfx/braindamage.wav", "res://sfx/gaugefill.wav", "res://sfx/boomboombakudan.wav"]
var debug = false
const release = "R0.3.0-beta"
const release = "R0.3.0-dev"
var sk = false
var gamepad = 0
var quest = [0, 0, 0, 0, 0, 0]
var isresume = false
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.

View file

@ -30,7 +30,7 @@ func _ready() -> void:
func _input(event):
gamepadtest.new(event)
# Mouse in viewport coordinates.
if Input.is_action_just_pressed("ui_cancel"):
if Input.is_action_just_pressed("ui_cancel") || Input.is_action_just_pressed("mclick"):
get_tree().change_scene("res://levels/ui/soundtest.tscn")
elif Input.is_action_pressed("ui_left") && Input.is_action_pressed("ui_up"):
fl.play(0)

View file

@ -56,6 +56,6 @@ func _complete():
func _input(event):
# Mouse in viewport coordinates.
if Input.is_action_just_pressed("ui_accept"):
if Input.is_action_just_pressed("ui_accept") || Input.is_action_just_pressed("mclick"):
#print("Mouse Click/Unclick at: ", event.position)
_complete()

View file

@ -55,7 +55,7 @@ func _process(delta):
pass
func _input(event):
if Input.is_key_pressed(KEY_ESCAPE) || (Input.is_joy_button_pressed(0,JOY_XBOX_A) && (Input.is_joy_button_pressed(0,JOY_XBOX_B))):
if Input.is_key_pressed(KEY_ESCAPE) || Input.is_action_just_pressed("mclick") || (Input.is_joy_button_pressed(0,JOY_XBOX_A) && (Input.is_joy_button_pressed(0,JOY_XBOX_B))):
get_tree().change_scene("res://levels/ui/debug.tscn")
gamepadtest.new(event)
if Global.gamepad == 1:

View file

@ -81,19 +81,22 @@ func _ready():
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if Global.isresume:
Global.isresume = false
_pausemenu()
var velocity = Vector2.ZERO
if (Global.live > 4 && Global.live < 9) || Global.live == 2:
_exit()
#velocity = (Vector2.RIGHT.rotated(rotation) * -100 * Global.xm * delta)-Vector2.UP.rotated(rotation) * -100 * Global.ym * delta
func _input(event):
if ismgamepad && (event is InputEventJoypadButton || Input.is_key_pressed(KEY_ENTER)):
if ismgamepad && (event is InputEventJoypadButton || Input.is_key_pressed(KEY_ENTER) || Input.is_action_just_pressed("mclick")):
ismgamepad = false
get_tree().root.remove_child(mgamepad)
Global.live = 1
gamepadtest.new(event)
if Input.is_action_just_pressed("Pause") && Global.cdialog == []:
if Input.is_action_just_pressed("Pause") && Global.live == 1:
_pausemenu()
#Global.exitgame = true
if Global.live == 1 && Input.is_action_pressed("schar") && Input.is_action_just_pressed("ui_up"):
@ -131,9 +134,11 @@ func _input(event):
bgsound.play(0)
if Global.live != 1 && ishud:
get_tree().root.remove_child(thud)
get_tree().root.remove_child(tcontrol)
ishud = false
elif Global.live == 1 && !ishud:
call_deferred("_thud")
call_deferred("_tcontrol")
ishud = true
func _statrebase():
if Global.debug:

View file

@ -58,3 +58,7 @@ func _on_warp_pressed() -> void:
else:
Global.cplace = [0, 0, 0]
Global.live = 5
func _on_Resume_pressed():
Global.isresume = true

View file

@ -172,5 +172,14 @@ custom_fonts/font = ExtResource( 2 )
custom_styles/focus = SubResource( 5 )
text = "MENU_EXIT"
[node name="Resume" type="Button" parent="CanvasLayer"]
margin_left = 314.0
margin_top = 150.0
margin_right = 487.0
margin_bottom = 204.0
custom_fonts/font = ExtResource( 2 )
text = "Resume"
[connection signal="pressed" from="CanvasLayer/HBoxContainer2/VBoxContainer/Warp" to="." method="_on_warp_pressed"]
[connection signal="pressed" from="CanvasLayer/HBoxContainer2/VBoxContainer2/Exit" to="." method="_on_exit_pressed"]
[connection signal="pressed" from="CanvasLayer/Resume" to="." method="_on_Resume_pressed"]

View file

@ -54,3 +54,11 @@ func _on_Right_pressed():
func _on_Right_released():
Input.action_release("ui_right")
func _on_Select_pressed():
Input.action_press("Pause")
func _on_Select_released():
Input.action_release("Pause")

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=12 format=2]
[gd_scene load_steps=14 format=2]
[ext_resource path="res://levels/ui/touchcontrols.gd" type="Script" id=1]
[ext_resource path="res://sprites/buttons/B.png" type="Texture" id=2]
@ -9,6 +9,8 @@
[ext_resource path="res://sprites/buttons/X.png" type="Texture" id=7]
[ext_resource path="res://sprites/buttons/RB.png" type="Texture" id=8]
[ext_resource path="res://sprites/buttons/RT.png" type="Texture" id=9]
[ext_resource path="res://sprites/buttons/Select.png" type="Texture" id=10]
[ext_resource path="res://sprites/buttons/Start.png" type="Texture" id=11]
[sub_resource type="Gradient" id=3]
offsets = PoolRealArray( 0.583333, 1 )
@ -25,22 +27,18 @@ script = ExtResource( 1 )
[node name="B" type="TouchScreenButton" parent="CanvasLayer"]
position = Vector2( 1142, 586 )
scale = Vector2( 1.5, 1.5 )
normal = ExtResource( 2 )
[node name="A" type="TouchScreenButton" parent="CanvasLayer"]
position = Vector2( 1007, 586 )
scale = Vector2( 1.5, 1.5 )
normal = ExtResource( 3 )
[node name="Y" type="TouchScreenButton" parent="CanvasLayer"]
position = Vector2( 1142, 479 )
scale = Vector2( 1.5, 1.5 )
normal = ExtResource( 4 )
[node name="X" type="TouchScreenButton" parent="CanvasLayer"]
position = Vector2( 1007, 479 )
scale = Vector2( 1.5, 1.5 )
normal = ExtResource( 7 )
[node name="R1" type="TouchScreenButton" parent="CanvasLayer"]
@ -79,6 +77,14 @@ position = Vector2( 203, 530 )
scale = Vector2( 2, 54.9999 )
normal = SubResource( 4 )
[node name="Select" type="TouchScreenButton" parent="CanvasLayer"]
position = Vector2( 431, 526 )
normal = ExtResource( 10 )
[node name="Start" type="TouchScreenButton" parent="CanvasLayer"]
position = Vector2( 743, 526 )
normal = ExtResource( 11 )
[connection signal="pressed" from="CanvasLayer/A" to="." method="_on_A_pressed"]
[connection signal="released" from="CanvasLayer/A" to="." method="_on_A_released"]
[connection signal="pressed" from="CanvasLayer/Up" to="." method="_on_Up_pressed"]
@ -89,3 +95,5 @@ normal = SubResource( 4 )
[connection signal="released" from="CanvasLayer/Left" to="." method="_on_Left_released"]
[connection signal="pressed" from="CanvasLayer/Right" to="." method="_on_Right_pressed"]
[connection signal="released" from="CanvasLayer/Right" to="." method="_on_Right_released"]
[connection signal="pressed" from="CanvasLayer/Select" to="." method="_on_Select_pressed"]
[connection signal="released" from="CanvasLayer/Select" to="." method="_on_Select_released"]

View file

@ -30,7 +30,7 @@ func _input(event):
updatehud()
# Mouse in viewport coordinates.
if !Global.sk && Input.is_action_just_pressed("ui_accept"):
if !Global.sk && Input.is_action_just_pressed("ui_accept") || Input.is_action_just_pressed("mclick"):
#print("Mouse Click/Unclick at: ", event.position)
_title()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

View file

@ -34,7 +34,7 @@ func _input(event):
# Mouse in viewport coordinates.
gamepadtest.new(event)
updatehud()
if Input.is_action_just_pressed("ui_accept"):
if Input.is_action_just_pressed("ui_accept") || Input.is_action_just_pressed("mclick"):
#print("Mouse Click/Unclick at: ", event.position)
get_tree().change_scene("res://levels/ui/tmenu.tscn")
#_level()