Changeset 41:1d087f79ca29


Ignore:
Timestamp:
Sep 1, 2013, 3:40:43 PM (7 years ago)
Author:
Simon Cross <hodgestar@…>
Branch:
default
rebase_source:
58a2297a2e86ed32324e3f949e01025d25f34640
Message:

Use fixed timestemp because pymunk docs say this is an order of magnitude more efficient.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/engine.py

    r37 r41  
    1414        self._clock = pygame.time.Clock()
    1515        self._fps = constants.FPS
     16        self._dt = 1. / self._fps
    1617        self._world = None  # TODO: create the world
    1718        self._current_screen = None
     
    3940                else:
    4041                    self._current_screen.handle_event(ev)
     42            self._current_screen.tick(self._dt)
    4143            self._current_screen.render(self._surface)
    4244            pygame.display.flip()
    43             ms = self._clock.tick(self._fps)
    44             self._current_screen.tick(ms / 1000.)
     45            self._clock.tick(self._fps)
Note: See TracChangeset for help on using the changeset viewer.