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
Fix event poll in pygame and fix UnboundLocalError #26 #27
Conversation
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.
I tried doing this before, doesn't work. I spent a lot of time finding a fix but nothing I tried worked so raised an issue.
When you test, the stick doesn't grow. Also this may help.
|
Just a suggestion - However @srevinsaju fixed it. I havent tested. |
|
Happy to explain I guess this has some advantage because
The last two are one of the reasons, why I chose this method, you can also see the PR title which corresponds to the same idea. By more features, I mean, Either way But it all depends on how its implemented |
|
Tested 3a3e6b1, works fine for me . |
|
Great! Thanks @Saumya-Mishra9129 |
|
Tested! Worked just as expected! Thanks @srevinsaju |
|
I'm not able to get the traceback after playing for some time so I'll leave @quozl to review. |
|
The change is such that an event queue with multiple key 273 down and up events are compressed into a single boolean flag which is then tested after the event queue is flushed. This doesn't seem right to me; it would be more normal to process the key down and up events as they occur rather than lose the extra ones. Can you explain why you want to lose the extra ones? |
|
@quozl have you played the game? |
|
Yes. Most of the time it works properly, but some of the time the stick starts growing without being requested. This is native execution on a laptop with a keyboard. As the many of you seem to prefer VMs, I'm not sure I'm seeing what others are seeing. I don't expect Sugar to be used in a VM by the end user. |
|
ok @quozl, thats something which we didn't notice. I tested on native device (as I prefer native device over VMs), but I have not been able to reproduce the stick growing thing. This implies, this PR might not be yet ready to merge. I will debug this. Thanks for letting me know |
|
@quozl I am afraid, I cannot reproduce. Played the game for 30 minutes. I can control the growing of the stick whenever I want, except if the stick grows longer than the total screen width, raises a traceback I am not using an XO laptop to test the activity, I have tested on two systems on native Sugar 0.117 (G31M-ES2C Gigabyte Motherboard, Intel Core Duo 2) with Mechanical Keyboard (Genius); and on a laptop (Intel Core i7, Butterfly keyboard). I am confused now. |
Thanks for trying.
So if you agree with @JuiP's patches, and they improve your work, please include them in your pull request branch. I don't see why you would not do so. |
|
Merged to #25 |
Resolves #26
@JuiP kindly review