Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 16874

Discover Python and Patterns (8): Game Loop pattern

$
0
0

The time has come to see our first design pattern: the Game Loop Pattern! This pattern can give us many good ideas to refactor our game in a very effective way.

This post is part of the Discover Python and Patterns series

The Game Loop pattern

There is several version of the Game Loop pattern. Here I present a simple case with a single thread. The following 5 functions form this pattern:

The Game Loop pattern

 

  • The init() function is called at startup to initialize the game and its data. In the following, I name this data the game state.
  • The processInput() function …

Viewing all articles
Browse latest Browse all 16874

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>