Skip to content
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

🐍 snakegame uses a background task, and is actually playable now #150

Merged
merged 6 commits into from
Oct 10, 2023

Conversation

masenf
Copy link
Collaborator

@masenf masenf commented Sep 29, 2023

  • use rx.background_task for main game loop, so inputs stays responsive while the loop is sleeping
  • use a move queue so that really fast inputs can be handled correctly
  • speed up the game as snake eat more food
  • better "game over" handling
  • keyboard controls
  • factor out common bits of UI code
  • reformat the code to be more modern and nice looking
  • add comments and docstrings for better understanding of how the code works

Still waiting on bug fix reflex-dev/reflex#1889 and new release before this can merge.

Add docstrings and comments

Separate UI into sub functions

Move defaults and constants to module level
@Lendemor Lendemor merged commit 3dd6a2d into main Oct 10, 2023
23 checks passed
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.

2 participants