Skip to content

Commit

Permalink
Fix game loop's order
Browse files Browse the repository at this point in the history
draw is now last after update()
  • Loading branch information
Mahi committed Apr 14, 2017
1 parent 1fab772 commit 2bdb532
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ easier and more pythonic than before. It implements easy scene management tools

Create scenes by subclassing `ezpygame.Scene` and overriding any of the following methods:

- `handle_event(self, event)`
- `draw(self, screen)`
- `update(self, dt)`
- `handle_event(self, event)`
- `on_enter(self, previous_scene)`
- `on_exit(self, next_scene)`

Expand Down
6 changes: 3 additions & 3 deletions ezpygame/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ def run(self, scene=None):

while self.active_scene is not None:

self.active_scene.draw(self._screen)
pygame.display.update()

for event in pygame.event.get():
self.active_scene.handle_event(event)
if event.type == pygame.QUIT:
Expand All @@ -113,3 +110,6 @@ def run(self, scene=None):

dt = clock.tick(self.update_rate)
self.active_scene.update(dt)

self.active_scene.draw(self._screen)
pygame.display.update()

0 comments on commit 2bdb532

Please sign in to comment.