Changeset 41:1d087f79ca29 for nagslang


Ignore:
Timestamp:
09/01/13 15:40:43 (8 years ago)
Author:
Simon Cross <hodgestar@…>
Branch:
default
Phase:
public
Rebase:
35386132323937613265383665643332333234653366393439653031303235643235663334363430
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.