-
Notifications
You must be signed in to change notification settings - Fork 346
Examples broken call to View.close on ESC #2538
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
Comments
Nice catch. This is just lingering code after many examples were converted into |
Be free to make a PR :) |
We may want to look at some proxying mechanism in classes + sphinx in the future. For the time being, the simplest solution's probably the best. |
For now we should use |
Fixed in the referenced PR |
Ah, good to know that there's For newcomers like me it's difficult to understand the coding patterns when or why to subclass Window or View or when to create extra classes and how they relate. If any experienced dev has capacity to write a docs page on that I think that would be very useful. I plan to teach a 16 year old Python including OOP using Arcade soon, but to be honest I still haven't figured out what good practices are where to introduce more or less classes. I did find https://youtu.be/7TdbpIOfosQ?si=JKeoMyNsAYjTR6uV yesterday which explains a coding pattern of having a separate Game class from Window when using pure pyglet. Would be great to have something similar as docs page and/or video for Arcade. The docstring of arcade.View mentions that it's good to have multiple View classes to represent different "screens" like intro/main/game over screens. But then I think the examples I saw so far don't follow that recommendation!?
There's still a bug in this one: arcade/arcade/examples/dual_stick_shooter.py Lines 278 to 282 in 7717e3f
There's two I'll re-open the ticket. Apologies for not simply sending a PR - as mentioned it's not clear to me what a good solution here is. Introduce a second different key or change the elif so that pressing ESC twice will close the window? |
Fixed the double ESC check and created this #2549 We definitely need better docs. We restructured the entire thing in 3.0.0 and now we can keep improving the content. |
There's a few examples that call
View.close
onESC
key.Here:
arcade/arcade/examples/astar_pathfinding.py
Lines 216 to 218 in 333ce6e
Here:
arcade/arcade/examples/asteroid_smasher.py
Lines 317 to 319 in 333ce6e
Here, but it's dead code since ESC is tested twice in elif statements and only the first is executed:
arcade/arcade/examples/dual_stick_shooter.py
Lines 278 to 282 in 333ce6e
Here:
arcade/arcade/examples/slime_invaders.py
Lines 202 to 203 in 333ce6e
I presume this is a recent API change, but I don't see it mentioned here!?
https://github.com/pythonarcade/arcade/blob/development/CHANGELOG.md#window-and-view
What is the proper fix / coding pattern here to process ESC when sub-classing arcade.View?
I can send a PR if you let me know.
The text was updated successfully, but these errors were encountered: