Objective: My goal is to express what goes into making a simple moving cube that can jump and move using the Blender Game Engine and Blender Game Logic.
Materials:
- Blender (the software)
Methods:
- Open Blender
- Set the rendering to “Blender Game”
- Click the button on the lower left and select Logic Editor
- In the main Blender window, create a cube
- Flatten the cube and make it wide
- Create another cube
- Flatten this cube and make it wide
- Position this “cube” and move it above the larger flat “cube”
- Create a final cube
- Go to physics and select Dynamic for the Physics Type
- Create 5 Keyboard sensors in the Logic Editor
- Name each one each of the following: Forward, Back, Left, Right, Jump
- Create a collision sensor
- For the assign the following keys to the following sensors:
- forward: w
- back: s
- left: a
- right: d
- jump: *spacebar*
- For jump, make sure the sensor has tap is pressed/highlighted
- Create five And controllers
- Create five Motion actuators
- Name them the same as your keyboard sensors
- For forward, put a positive number into Linear’s X equal to back’s
- For back, put a negative number into Linear’s X equal to forward’s
- For left, put a negative number into Linear’s Y equal to right’s
- For right, put a positive number into Linear’s Y equal to left’s
- For jump, put a positive number into Linear’s Z (I suggest 5 or more)
- At the end of Linear for each of the actuators, select L and A.
- Next to each sensor, controller, and actuator are small circles; connect them directly across for each keyboard sensor
- For the collision sensor, connect the circle to the final And controller
Results: A playable platformer! Quite fun. It worked exactly the way I wanted. Hopefully it will for anyone who follows the above methods as well.
Discussion: In the process of making this I ran into several problems, including jumping into space, hovering, jumping while jumping, and movement being too slow due to a low value. Despite this, it’s the second time I’ve used Blender Game Engine, and the first time I’ve managed something like this. I would like to figure out in the future how to make it so that the RGB value of an object changes when collided with, but that may be a ways off.