Honker Railway

This commit is contained in:
Page Asgardius 2024-08-16 13:54:37 -07:00
parent a43a3eb6dd
commit f6b36c722c
23 changed files with 505 additions and 30 deletions

View file

@ -56,3 +56,9 @@ func _on_lilytest_pressed() -> void:
Global.dplace = [0, 0, 0]
Global.live = 1
get_tree().change_scene_to_file("res://levels/ui/gameplay.tscn")
func _on_dialogtest_pressed() -> void:
Global.dplace = [1, 8, 11]
Global.live = 1
get_tree().change_scene_to_file("res://levels/ui/gameplay.tscn")

View file

@ -67,7 +67,7 @@ text = "MENU_MAP"
layout_mode = 2
theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs")
text = "BUTTON_PLACEHOLDER"
text = "Honker Railway"
[node name="Bullethell" type="Button" parent="VBoxContainer"]
layout_mode = 2
@ -95,4 +95,5 @@ text = "BUTTON_RETURN"
[connection signal="pressed" from="VBoxContainer/L20" to="." method="_on_l_20_pressed"]
[connection signal="pressed" from="VBoxContainer/Lilytest" to="." method="_on_lilytest_pressed"]
[connection signal="pressed" from="VBoxContainer/Dialogtest" to="." method="_on_dialogtest_pressed"]
[connection signal="pressed" from="VBoxContainer/Back" to="." method="_on_back_pressed"]

View file

@ -1,5 +1,6 @@
extends Control
const gamepadtest = preload("res://gamepad.gd")
var joyname
var lxaxis
var lyaxis
@ -56,7 +57,15 @@ func _process(delta):
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))):
get_tree().change_scene_to_file("res://levels/ui/debug.tscn")
joyname.set_text("Current Device: "+str(Input.get_joy_name(0))+"\nIf drift threshold is 0.2 or higher, your gamepad need new sticks")
gamepadtest.new(event)
if Global.gamepad == 1:
joyname.set_text("Current Device: "+str(Input.get_joy_name(0))+"\nController Type: Western"+"\nIf drift threshold is 0.2 or higher, your gamepad need new sticks")
elif Global.gamepad == 2:
joyname.set_text("Current Device: "+str(Input.get_joy_name(0))+"\nController Type: Japanese"+"\nIf drift threshold is 0.2 or higher, your gamepad need new sticks")
elif Global.gamepad == 3:
joyname.set_text("Current Device: "+str(Input.get_joy_name(0))+"\nController Type: Geo"+"\nIf drift threshold is 0.2 or higher, your gamepad need new sticks")
elif Global.gamepad == 0:
joyname.set_text("Current Device: "+str(Input.get_joy_name(0))+"\nController Type: Keyboard"+"\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)))
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)))

View file

@ -1,4 +1,5 @@
extends Node2D
const gamepadtest = preload("res://gamepad.gd")
var level
var player
var music
@ -58,21 +59,7 @@ func _process(delta):
#velocity = (Vector2.RIGHT.rotated(rotation) * -100 * Global.xm * delta)-Vector2.UP.rotated(rotation) * -100 * Global.ym * delta
func _input(event):
Global.xm = 0
Global.ym = 0
if Global.live == 1 && !Input.is_action_pressed("schar"):
if Input.get_joy_axis(0,JOY_AXIS_LEFT_X) > 0.2 || Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) > 0.2 || Input.get_joy_axis(0,JOY_AXIS_LEFT_X) < -0.2 || Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) < -0.2:
Global.xm = Input.get_joy_axis(0,JOY_AXIS_LEFT_X)
Global.ym = Input.get_joy_axis(0,JOY_AXIS_LEFT_Y)
else:
if Input.is_action_pressed("ui_left"):
Global.xm = -1
if Input.is_action_pressed("ui_right"):
Global.xm = 1
if Input.is_action_pressed("ui_up"):
Global.ym = -1
if Input.is_action_pressed("ui_down"):
Global.ym = 1
gamepadtest.new(event)
if Input.is_action_just_pressed("Pause") && Global.cdialog == []:
_pausemenu()
#Global.exitgame = true