Category Archives: Game Engine

New Tutorial – Developing a Practise Level For a Simple Ball Game

A new video tutorial, split into three parts, develops a simple ball game started in previous tutorials, go to the following page to see the full set –

http://blender.freemovies.co.uk/introduction-to-the-game-engine-making-a-simple-ball-game/

The first part of the tutorial replaces a message sending system to keep the score, with a system that uses the global dictionary object. This has the advantage of not being reset when the level restarts.

Blender 2.5 Tutorial Developing a Simple Ball Game Part 1 Keeping Score Using the Global Dictionary

The second part shows how to restart the level when the ball misses the holes and falls off, in a previous version a timer was used to restart the level, in this version, the height of the ball is used.  Also ‘pressing Q to quit’ is added.

Blender 2.5 Developing a Simple Ball Game Part 2 Detecting the Height of the Ball & Press Q to Quit

The third part of the the tutorial shows how to display the score within the came using a dynamic text display.

Blender 2.5 Developing a Simple Ball Game Part 3 Displaying the Score using a Dynamic Text Display

File needed at the start of the tutorial – rotatingPlanePractice.blend

Finished practice level of game – rotatingPlanePractice13.blend

New Version of Game Engine Dynamic Text Display Tutorial

Blender 2.5 Game Engine Tutorial Dynamic Text Display (New Version)

You can always add text objects to a scene (using the Add menu) but they are static and cannot be changed during the game. The score obviously changes during a game and so you need dynamic text to display it.

Tutorials created recently have been experimenting with the game engine’s input and output facilities for making interactive applications (including games).

The updated version was created because of a comment from dberube4 about setting the transparency to alpha (making the background transparent) which means you do not have to set up materials and so a much shorter tutorial. You can still parent the display to a black background plane if you want to but that is straight forward.

This is the finished file from the tutorial textDisplay9a.blend

You can append the text display object from the file into a game you are developing that needs a display. I show how to do this is the final part of a tutorial on developing a practice level of simple ball game.

Blender 2.5 Developing a Simple Ball Game Part 3 Displaying the Score using a Dynamic Text Display

 

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.