Skip to content

remove pause #1993

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

Conversation

DigiDuncan
Copy link
Collaborator

This is super unnecessary and nothing uses it (now). Even before this PR, it was used once. So, I'm counting this as "weird cruft that should be cut in 3.0." If it's a teaching concern, I recommend to teach them to use time.sleep().

Changes

  • Removes arcade.pause()

This is super unnecessary and nothing uses it (now). Even before this PR, it was used once. So, I'm counting this as "weird cruft that should be cut in 3.0." If it's a teaching concern, I recommend to teach them to use `time.sleep()`.
@einarf
Copy link
Member

einarf commented Feb 25, 2024

I don't mind removing this one, but if it's referenced in teaching material we migh just need to keep it. Outside of that I don't mind removing it. Especially if it's mainly a thing used internally in tests.

@pvcraven Any input on this one?

@DigiDuncan
Copy link
Collaborator Author

I don't mind removing this one, but if it's referenced in teaching material we migh just need to keep it. [...]

From what I can tell, the docs don't reference arcade.pause() at any point. I don't have access to Paul's textbooks, obviously, but again, those textbooks would be outdated post-3.0 anyway and would require updating.

@pushfoo
Copy link
Member

pushfoo commented Feb 25, 2024

TL;DR: We might want to keep the method but rethink what it does

I don't have access to Paul's textbooks

I think we do: https://learn.arcade.academy/en/latest/

The git history shows Paul C's been updating it, but it doesn't seem to reference the method.

What we have now

arcade.pause()'s current behavior seems a little counter-intuitive: it pauses all execution, not just gameplay. For just getting started, this sort of makes sense.

What should we have?

Pause behavior in real-time games usually takes the following approach:

  1. Game state ceases updating
  2. Animation and sound effect playback may pause
  3. The UI remains interactive, but may change to a menu / pause screen
  4. Music and ambiance may keep playing

How could we support that?

  1. Have arcade.pause() call a Window.pause() method
  2. The Window's handler can respond directly, or defer to a View's implementation
  3. Users can override this behavior or defer to other handlers which do things like pause a subset of event scheduling

Copy link
Member

@pvcraven pvcraven left a comment

Choose a reason for hiding this comment

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

I'm ok removing this function.

@pushfoo
Copy link
Member

pushfoo commented Feb 25, 2024

Removing the top-level function works too. It doesn't stop any of that other implementation from happening later. 👍

@DigiDuncan
Copy link
Collaborator Author

I really like the idea of an on_pause or something like it on Window/View. Newcomers having to separate their game-loop code into a big if self.paused check can be annoying and counter-intuitive, even for experience developers. Something for the future!

@pushfoo
Copy link
Member

pushfoo commented Feb 25, 2024

Those ideas tie into a larger rework of events / input that we don't have time for rn. This PR comment thread also isn't the place to discuss it imo. We should merge this.

@einarf
Copy link
Member

einarf commented Feb 25, 2024

Today it's pause()'s funeral. Bring flowers.

@einarf einarf merged commit 282f618 into pythonarcade:development Feb 25, 2024
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.

4 participants