Book Image

Blender Game Engine: Beginner's Guide

Book Image

Blender Game Engine: Beginner's Guide

Overview of this book

Blender Game Engine is the part of the Blender 3D editor used to create actual 3D video games. It's the ideal entry level game development environment because you don't even need to learn to program. Create a complete game using Bender's innovative logic bricks."Blender Game Engine: Beginner's Guide" is the ideal introduction to game development. Using only logic bricks, the reader will create a complete game in Blender. By the end of the book the reader will be able to use their skills to create their own 3D games.
Table of Contents (11 chapters)
10
Index

Time for action — decreasing life

Let's start by creating a simple life bar (two bars). Remember that the life bar is green or blue, and when you lose life the bar becomes red. Try to create a rectangle of the color you want, create another similar rectangle a bit away in the same front axis, and change its color to red.

  1. Make a rectangle and duplicate it. Move to the z axis (press Z to snap it), and choose the color for each one, just as shown in the following screenshot:
    Time for action — decreasing life

    Tip

    Put the cursor on the center-left edge of the rectangle, as shown in the previous screenshot.

  2. Press I (I not L) to insert a key in the first frame, and another again in the hundredth frame, to scale the rectangle. Make the rectangle as tiny as you like in the first frame, and set it to the default rectangle shape in frame 100. See the split images in the following screenshot and observe the difference:
    Time for action — decreasing life
  3. Insert it in the scene with the player (maybe a whale) and the object with which the collision occurs (a little...