-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Bugfix/i578 #587
base: main
Are you sure you want to change the base?
WIP: Bugfix/i578 #587
Conversation
I think this may not correctly trigger |
Now i feel a little bit ashamed i could have submitted a pr but i didn't found the time. Thank you for taking the initiative, with these changes all my tests are working again. It seems that ´is_action_just_pressed´ is working. |
I found that the problem with |
… Input global Singleton again. See: bitwes/Gut#587 Then, adjusted test for moving the player right to actually work instead of just fooling myself with the newly set position. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. The code change looks good. I'd like some additional testing to verify that the Input.is_action_just_*
methods work as expected. If you change the InputSingletonTracker
to the code below, you should be able to make assertions that they are working.
NOTE When I tried verifying that is_action_just_pressed
was working I had to add a leading wait_frames
for the InputSingletonTracker
to detect the frame when the action goes down
_sender.wait_frames(1).action_down("jump").hold_for('10f')
await wait_for_signal(_sender.idle, 5)
Here's my take on InputSingletonTracker
class InputSingletonTracker:
extends Node
var pressed_frames = []
var just_pressed_count = 0
var just_released_count = 0
var _frame_counter = 0
func _process(delta):
_frame_counter += 1
if(Input.is_action_just_pressed("jump")):
just_pressed_count += 1
if(Input.is_action_just_released("jump")):
just_released_count += 1
if Input.is_action_pressed("jump"):
pressed_frames.append(_frame_counter)
The hope here is to resolve #578
I haven't done any cleanup as suggested by @bitwes over in the issue thread. But the fix he suggested works just fine, and this PR is evidence of that.