Skip to content

Conversation

@lucas-james
Copy link
Contributor

Related to the following issue: #119

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
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

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants