Skip to content

Small refactor and optimization#22

Open
psergicv wants to merge 1 commit intotechwithtim:masterfrom
psergicv:psergicv-features
Open

Small refactor and optimization#22
psergicv wants to merge 1 commit intotechwithtim:masterfrom
psergicv:psergicv-features

Conversation

@psergicv
Copy link

When running the code, there was an error message "TypeError: Iterating over key states is not supported" comes from this section of your code:

keys = pygame.key.get_pressed()

for key in keys:
    # ...

Instead, you should check the state of specific keys directly, without a loop.

Also added Error Handlings in the main function. It should make the code more robust and easier to debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant