gamepad test

This commit is contained in:
Page Asgardius 2024-01-27 09:06:31 -07:00
parent 02d51b083e
commit 0fac09f683
4 changed files with 110 additions and 5 deletions

View file

@ -40,6 +40,7 @@ Provided as a replacement for a HP 14 laptop that died while running Genshin Imp
Steam Deck Steam Deck
Arch Linux Rolling Arch Linux Rolling
Used as developmenjt device since 0.0.0-dev release
Provided by Evelyn Freeman Provided by Evelyn Freeman
HP Pavilion x360 HP Pavilion x360
@ -55,6 +56,8 @@ Creative Staff
Page Asgardius Page Asgardius
Beachkid Beachkid
Sakura Nakayama Sakura Nakayama
El Profe
Goldfish
Music Music
Soundtrack provided by archive.org and Bandcamp Soundtrack provided by archive.org and Bandcamp
@ -99,7 +102,7 @@ Radioactive Desert
crammin jammin crammin jammin
Vince Kaichan Vince Kaichan
Boss Fight (Earth) Natasha's Theme
The Func The Func
Vince Kaichan Vince Kaichan
@ -490,6 +493,18 @@ For let me know that a Heavy Machine Gun can be turned into a good stage boss
OMOCAT OMOCAT
For let me know that sketch graphics can give good results For let me know that sketch graphics can give good results
Beachkid
Who died pursuing martian love 1999-2023
El Profe
For giving me great ideas for Asgardius Virtualx Project
Matt Bozon
For his unique humour in Shantae game series
Valve Corporation
For that great development device
Contact info Contact info
Email Email

View file

@ -9,6 +9,18 @@ var dpadup
var dpaddown var dpaddown
var dpadleft var dpadleft
var dpadright var dpadright
var lt
var rt
var ls
var rs
var l3
var r3
var view
var menu
var xb
var yb
var ab
var bb
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
@ -19,6 +31,20 @@ func _ready():
ryaxis = $"BoxContainer/VBoxContainer2/Right Y Axis" ryaxis = $"BoxContainer/VBoxContainer2/Right Y Axis"
dpadup = $"BoxContainer/VBoxContainer/DPAD Up" dpadup = $"BoxContainer/VBoxContainer/DPAD Up"
dpaddown = $"BoxContainer/VBoxContainer2/DPAD Down" dpaddown = $"BoxContainer/VBoxContainer2/DPAD Down"
dpadleft = $"BoxContainer/VBoxContainer/DPAD Left"
dpadright = $"BoxContainer/VBoxContainer2/DPAD Right"
lt = $"BoxContainer/VBoxContainer/Left Trigger"
rt = $"BoxContainer/VBoxContainer2/Right Trigger"
ls = $"BoxContainer/VBoxContainer/Left Shoulder"
rs = $"BoxContainer/VBoxContainer2/Right Shoulder"
l3 = $"BoxContainer/VBoxContainer/Left Stick"
r3 = $"BoxContainer/VBoxContainer2/Right Stick"
view = $BoxContainer/VBoxContainer/View
menu = $BoxContainer/VBoxContainer2/Menu
xb = $BoxContainer/VBoxContainer/X
yb = $BoxContainer/VBoxContainer2/Y
ab = $BoxContainer/VBoxContainer/A
bb = $BoxContainer/VBoxContainer2/B
#pass # Replace with function body. #pass # Replace with function body.
@ -30,8 +56,24 @@ func _process(delta):
func _input(event): func _input(event):
if Input.is_key_pressed(KEY_ESCAPE) || (Input.is_joy_button_pressed(0,JOY_BUTTON_A) && (Input.is_joy_button_pressed(0,JOY_BUTTON_B))): if Input.is_key_pressed(KEY_ESCAPE) || (Input.is_joy_button_pressed(0,JOY_BUTTON_A) && (Input.is_joy_button_pressed(0,JOY_BUTTON_B))):
get_tree().change_scene_to_file("res://levels/ui/debug.tscn") get_tree().change_scene_to_file("res://levels/ui/debug.tscn")
joyname.set_text("Current Device: "+str(Input.get_joy_name(0))) joyname.set_text("Current Device: "+str(Input.get_joy_name(0))+"\nIf drift threshold is 0.2 or higher, your gamepad need new sticks")
lxaxis.set_text("Left X Axis "+str(Input.get_joy_axis(0,JOY_AXIS_LEFT_X))) lxaxis.set_text("Left X Axis "+str(Input.get_joy_axis(0,JOY_AXIS_LEFT_X)))
lyaxis.set_text("Left Y Axis "+str(Input.get_joy_axis(0,JOY_AXIS_LEFT_Y))) lyaxis.set_text("Left Y Axis "+str(Input.get_joy_axis(0,JOY_AXIS_LEFT_Y)))
rxaxis.set_text("Right X Axis "+str(Input.get_joy_axis(0,JOY_AXIS_RIGHT_X))) rxaxis.set_text("Right X Axis "+str(Input.get_joy_axis(0,JOY_AXIS_RIGHT_X)))
ryaxis.set_text("Right Y Axis "+str(Input.get_joy_axis(0,JOY_AXIS_RIGHT_Y))) ryaxis.set_text("Right Y Axis "+str(Input.get_joy_axis(0,JOY_AXIS_RIGHT_Y)))
dpadup.set_text("DPAD Up "+str(Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_UP)))
dpaddown.set_text("DPAD Down "+str(Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_DOWN)))
dpadleft.set_text("DPAD Left "+str(Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_LEFT)))
dpadright.set_text("DPAD Right "+str(Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_RIGHT)))
lt.set_text("Left Trigger "+str(Input.get_joy_axis(0,JOY_AXIS_TRIGGER_LEFT)))
rt.set_text("Right Trigger "+str(Input.get_joy_axis(0,JOY_AXIS_TRIGGER_RIGHT)))
ls.set_text("Left Shoulder "+str(Input.is_joy_button_pressed(0,JOY_BUTTON_LEFT_SHOULDER)))
rs.set_text("Right Shoulder "+str(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER)))
l3.set_text("Left Stick "+str(Input.is_joy_button_pressed(0,JOY_BUTTON_LEFT_STICK)))
r3.set_text("Right Stick "+str(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_STICK)))
view.set_text("View "+str(Input.is_joy_button_pressed(0,JOY_BUTTON_BACK)))
menu.set_text("Menu "+str(Input.is_joy_button_pressed(0,JOY_BUTTON_START)))
xb.set_text("X "+str(Input.is_joy_button_pressed(0,JOY_BUTTON_X)))
yb.set_text("Y "+str(Input.is_joy_button_pressed(0,JOY_BUTTON_Y)))
ab.set_text("A "+str(Input.is_joy_button_pressed(0,JOY_BUTTON_A)))
bb.set_text("B "+str(Input.is_joy_button_pressed(0,JOY_BUTTON_B)))

View file

@ -83,7 +83,31 @@ text = "DPAD Up"
[node name="DPAD Left" type="Label" parent="BoxContainer/VBoxContainer"] [node name="DPAD Left" type="Label" parent="BoxContainer/VBoxContainer"]
layout_mode = 2 layout_mode = 2
text = "X Axis" text = "DPAD Left"
[node name="Left Trigger" type="Label" parent="BoxContainer/VBoxContainer"]
layout_mode = 2
text = "Left Trigger"
[node name="Left Shoulder" type="Label" parent="BoxContainer/VBoxContainer"]
layout_mode = 2
text = "Left Shoulder"
[node name="Left Stick" type="Label" parent="BoxContainer/VBoxContainer"]
layout_mode = 2
text = "Left Stick"
[node name="View" type="Label" parent="BoxContainer/VBoxContainer"]
layout_mode = 2
text = "View"
[node name="X" type="Label" parent="BoxContainer/VBoxContainer"]
layout_mode = 2
text = "X"
[node name="A" type="Label" parent="BoxContainer/VBoxContainer"]
layout_mode = 2
text = "A"
[node name="VBoxContainer2" type="VBoxContainer" parent="BoxContainer"] [node name="VBoxContainer2" type="VBoxContainer" parent="BoxContainer"]
layout_mode = 2 layout_mode = 2
@ -103,7 +127,31 @@ text = "DPAD Down
[node name="DPAD Right" type="Label" parent="BoxContainer/VBoxContainer2"] [node name="DPAD Right" type="Label" parent="BoxContainer/VBoxContainer2"]
layout_mode = 2 layout_mode = 2
text = "Y Axis" text = "DPAD Right"
[node name="Right Trigger" type="Label" parent="BoxContainer/VBoxContainer2"]
layout_mode = 2
text = "Right Trigger"
[node name="Right Shoulder" type="Label" parent="BoxContainer/VBoxContainer2"]
layout_mode = 2
text = "Right Shoulder"
[node name="Right Stick" type="Label" parent="BoxContainer/VBoxContainer2"]
layout_mode = 2
text = "Right Stick"
[node name="Menu" type="Label" parent="BoxContainer/VBoxContainer2"]
layout_mode = 2
text = "Menu"
[node name="Y" type="Label" parent="BoxContainer/VBoxContainer2"]
layout_mode = 2
text = "Y"
[node name="B" type="Label" parent="BoxContainer/VBoxContainer2"]
layout_mode = 2
text = "B"
[node name="Bottomhud" parent="." instance=ExtResource("4_88ejd")] [node name="Bottomhud" parent="." instance=ExtResource("4_88ejd")]
layout_mode = 1 layout_mode = 1

View file

@ -8,4 +8,4 @@ func _process(delta):
#20*623/633=19.6840442338 #20*623/633=19.6840442338
#Roll velocity calculator #Roll velocity calculator
#(14.0866856839 * music duration (seconds)) / Line count #(14.0866856839 * music duration (seconds)) / Line count
position.y -= delta * 12 position.y -= delta * 150