Loading Game Levels and Using the Python Global Dictionary

A new video tutorial has just been uploaded showing how in the Blender game engine you can load a next level stored in a different file.

The tutorial also shows how information can be passed to the new level (in the tutorial a score). To do this the ‘global dictionary’ object is used (in Python bge.logic.globalDict), which is a relatively easy way to pass information between objects (and files) without having to send messages.

The original ideas (and files) were taken from the Blender book ‘the Blender Gamekit 2nd Edition’ which was written for version 2.49 of Blender. The files are adapted to work with 2.5x and are demonstrated in the tutorial, then a simpler version is worked through.

Click the links for the tutorials –

Blender 2.5 Game Engine Tutorial How to Load a Second Level and Pass a Score to it Part 1 & Part 2

The files created in the tutorial – level1.blendlevel2.blend two levels of a game (dummy game) both must be saved in the same folder.

These are the files adapted from the Gamekit book – GlobalDict_L1b.blendGlobalDict_L2a.blend as above two levels of a game (dummy game) both must be saved in the same folder.

Leave a Reply