| Module: the_app | rdpyg/app/the_app.py | |||||||
|---|---|---|---|---|---|---|---|---|
|
TheApp is a class for making a game like application, implementing functionality common in many games. The idea is to make constructing games and demos quick, with minimal code. TODO: a way to chose between display flip and update. without overriding the whole method. There are a number of different methods with default implementations to save work. Most of these can be overridden if you need to specialise any parts. = How the main loop works. = TheApp class has a couple of different ways which it handles the main loop internally. It can use a while loop or the twisted reactor. However by using the methods provided you should not have to modify this. It can be instructional to have at a look at the source for different methods, so that overriding them can be easy. This is the 2d pygame version of the class. There is an opengl version named rdpyg.app.the_app_gl.TheAppGL = Commonly overridden methods =
= Order of operation = The order in which the different methods get called is to update your game objects, handle user input, do your display changes. Start() InitDislpay() Load() Loop()
Before loops starts looping:
LoopInit()
SetupTiming()
Every
|