Skip to content

General example changes #2581

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

Merged
merged 31 commits into from
Jul 11, 2024
Merged

Conversation

bilhox
Copy link
Contributor

@bilhox bilhox commented Nov 20, 2023

Hi, I took a look at all examples, and made some fixes.

aacircle.py :

  • Removed the pretty weird try block and replaced it by a beautiful while loop

aliens.py :

  • renamed all to all_sprite, because all is a native python function.
  • removed depth argument
  • added pygame.SCALED because on Windows, there is a problem with FULLSCREEN mode

chimp.py :

  • removed RenderPlainbecause it's deprecated
  • renamed some variables so it follows python naming convention

dropevent.py :

  • renamed some variables because either it doesn't follow the python naming convention, or it is not intuitive

playmus.py :

  • This is a proposition from Matiiss, switching from pygame.freetype to pygame.Font
  • Revamped the code, as its structure isn't understandable for a beginner.

resizing_new.py:

  • renamed a variable because it's not intuitive
    Removal plan is being discussed

scaletest.py :

  • removed useless alias
  • renamed some variables/functions because either it doesn't follow the python naming convention, or it is not intuitive

liquid.py :

  • renamed some variables/functions because either it doesn't follow the python naming convention, or it is not intuitive
  • remove time.sleep so it uses pygame.Clock

@bilhox bilhox requested a review from a team as a code owner November 20, 2023 21:43
@bilhox
Copy link
Contributor Author

bilhox commented Nov 20, 2023

This should fix #2518

@Starbuck5 Starbuck5 linked an issue Nov 22, 2023 that may be closed by this pull request
Matiiss added a commit to Matiiss/pygame-ce that referenced this pull request Jan 14, 2024
Copy link
Member

@MyreMylar MyreMylar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link
Member

@ankith26 ankith26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR needs a lint run to make CI happy

@MyreMylar MyreMylar requested a review from a team as a code owner May 25, 2024 20:13
Copy link
Member

@ankith26 ankith26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had already tested all these examples in the last reviewing round that I did. The code changes LGTM.
I will go ahead and merge this in now, though there is always scope for further improvements in future (in hopefully smaller and more focussed PRs).

Thanks for contributing! 🎉

@ankith26 ankith26 added this to the 2.5.1 milestone Jul 11, 2024
@ankith26 ankith26 merged commit 423fdb7 into pygame-community:main Jul 11, 2024
3 checks passed
@bilhox bilhox deleted the general_example_changes branch July 11, 2024 18:46
gresm pushed a commit to gresm/pygame-ce that referenced this pull request Jul 16, 2024
* scaletest.py fixes

* example fixes

* format fix

* format fixes

* liquid example fix

* format fic

* removed time import

* fix 1

* update example

* droid problem fixes

* alien example update

* chimp example

* removed durk from buildconfig

* Revert "removed durk from buildconfig"

This reverts commit d5897be.

* Revert "chimp example"

This reverts commit 5ed783e.

* chimp tutorial update

* format fix

* playmus fix

* Further aliens.py cleanups

* Further scaletest.py cleanups

* Update examples/aliens.py

* formatting

* scaletest fix using irl key access

* clock scaletest

* revert changes resizing_new

---------

Co-authored-by: Dan Lawrence <danintheshed@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecation warning in chimp.py example
6 participants