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

(Issue #119) Added pause functionality to builtins #123

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lucas-james
Copy link
Contributor

Related to the following issue: #119

@@ -3,6 +3,7 @@
import operator

from pygame.math import Vector2
from pgzero.builtins import pause, is_paused
Copy link
Owner

Choose a reason for hiding this comment

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

You don't need to import the builtins - anything in builtins is already available.


if update:
if update and not paused:
pgzclock.tick(dt)
Copy link
Owner

Choose a reason for hiding this comment

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

This is wrong - pgzclock needs to run if not paused, even if update is not defined.

pgzero/game.py Outdated
@@ -243,7 +250,7 @@ def mainloop(self):

pgzclock = pgzero.clock.clock

self.need_redraw = True
self.need_redraw = not paused
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think this is right - this is at the start of the game while the pause state will change during the game loop.

Moving the logic for need_redraw to more relevant places
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.

None yet

2 participants