Thursday, September 20, 2012

Homework 5: Blender Game Engine

the camera following the turtle
Check out my awesome Blender Game Engine skills
https://www.dropbox.com/s/ytxdyheunsz78m4/maze2.blend

let's talk about it

Using the game engine

A turtle was the object that I created in Blender. I decided to use the WASD keys to make the turtle move in different directions. I then created a maze using cylinders as walls for the turtle to navigate through with the direction keys.
The first thing I did was use the logic editor to assign keys to different directions,
W:forward
S:backwards
A:left
D:right
the game before the p-key
Spacebar:jump
I did this by using the keyboard sensor, AND and the motion actuator.
Then I created the maze so the player would have something to move the turtle around in and a floor (a flattened, resized cube) so that the objects would not fall immediately. Making the maze was not too difficult, but getting the turtle to interact with the maze walls was. To fix this problem I made a new puzzle that was less of a maze; instead it was a hallway that kept turning, with a few obstacles in the way. I made the maze walls with cylinders that I put in edit mode, then selected a few of the faces and extruded them to make them higher. When I did not have the walls at a certain height the turtle could just jump over them. I also had to use the physics engine to make the turtle dynamic, but leave all of the walls static. The walls had to have a mass of 20 so that the turtle would not be able to push through them instead of navigate around them.

turtle jumping up stairs
To make obstacles for the turtle to navigate through I created a staircase by extruding a cube for the turtle to jump over. I also used the empty object feature to create another obstacle. I put the empty object in the layer that had the maze and the turtle and put a cube in another layer. I edited the logic of the empty object with the sensor as ‘always’, AND and the ‘edit object’ actuator that made the cube from layer 2 appear in the first layer. I set the frequency of the empty object to create another cube every two seconds. 
turtle pushing the blocks to make a path
This obstacle was more difficult, the longer it took to reach it because there were more cubes to push out of the way.  
turtle navigating turns
While I was playing my game in a test run I realized that it looked weird that the turtle never turned around so sometimes he walked sideways and backwards. To fix this I changed the keys that moved the turtle left and right so that they rotated the turtle two degrees on the Z axis. So then the player could move the turtle to always be facing the way that it was walking.
Then I was having problems with the size of the turtle. He was too small to be seen behind some of the walls, but if I made him taller he either did not fit through the walls or stopped looking like a turtle. To fix this I connected the camera and the turtle using a parent-child relationship. So now the turtle can rotate to always be facing the direction he is moving and the camera follows behind the turtle.
This idea is the fourth of fifth in a series of failed ideas, some of which included a maze made out of one cube, a forest to navigate through and a staircase that got bigger and bigger as time went on.

How the Game Engine will relate to the game team 1 is developing

The game we are developing will involve a lot of movement. The game engine is how we will be able to connect keys of the keyboard to the movement of a character with the logic editor.  We will also need to use the game engine to set up the random encounter fights that happen throughout the game. 

No comments:

Post a Comment