Whose balls?

This commit is contained in:
CenTdemeern1 2025-04-29 22:04:22 +02:00
parent b1b2b6d803
commit 137c317f09
2 changed files with 14 additions and 13 deletions

View file

@ -53,7 +53,7 @@ signal emptiedCapture
signal pressedKey signal pressedKey
var costumeKeys = ["1","2","3","4","5","6","7","8","9","0"] var costumeKeys = ["1","2","3","4","5","6","7","8","9","0"]
signal spriteVisToggles(keysPressed:Array) signal spriteVisToggles(keysPressed:Array)
signal fatfuckingballs signal all_keys_released
func _ready(): func _ready():
Global.main = self Global.main = self
@ -133,7 +133,9 @@ func _ready():
camera.position = origin.position camera.position = origin.position
func _process(delta): func _process(delta):
process_key_presses($BackgroundInputCapture.get_keys()) var keys = $BackgroundInputCapture.get_keys()
process_key_presses(keys)
bgInputSprite(keys)
var hold = origin.get_parent().position.y var hold = origin.get_parent().position.y
origin.get_parent().position.y += yVel * 0.0166 origin.get_parent().position.y += yVel * 0.0166
@ -617,18 +619,17 @@ func process_key_presses(keys_pressed):
changeCostume(i+1) changeCostume(i+1)
# Handles background input for sprites
func bgInputSprite(node, keys_pressed): func bgInputSprite(keys_pressed: Array[Key]):
if fileSystemOpen: if fileSystemOpen:
return return
var keyStrings = []
for i in keys_pressed: if keys_pressed.size() <= 0:
if keys_pressed[i]: emit_signal("all_keys_released")
keyStrings.append(OS.get_keycode_string(i) if !OS.get_keycode_string(i).strip_edges().is_empty() else "Keycode" + str(i))
if keyStrings.size() <= 0:
emit_signal("fatfuckingballs")
return return
spriteVisToggles.emit(keyStrings) spriteVisToggles.emit(
keys_pressed.map(
func(i) -> String: return OS.get_keycode_string(i) if !OS.get_keycode_string(i).strip_edges().is_empty() else "Keycode" + str(i)
)
)

View file

@ -348,7 +348,7 @@ func _on_delete_pressed():
func _on_set_toggle_pressed(): func _on_set_toggle_pressed():
$VisToggle/setToggle/Label.text = "toggle: AWAITING INPUT" $VisToggle/setToggle/Label.text = "toggle: AWAITING INPUT"
await Global.main.fatfuckingballs await Global.main.all_keys_released
var keys = await Global.main.spriteVisToggles var keys = await Global.main.spriteVisToggles
var key = keys[0] var key = keys[0]