Bob The Blob
Torque’s Physics system gives game designers a great advantage. Rigid body physics comes standard with Torque. For Bob the Blob, our design called for our character to be able to manipulate objects around him. Every object in the game world is based on Data blocks. These are blocks of code that have give objects properties. To use Rigid Body Physics for the game, I had to specify which objects were able to be “pushed” or otherwise influenced by the player.
The ricochet shot allowed the player to shoot at objects that would otherwise be unreachable. We set up puzzles that allowed the player to hit switches to activate buttons and switches. Setting this up in Torque required modifying the game’s existing projectile data block. The existing data block causes the bullet to explode on impact. I found a line of code that controlled could delay the explosion. I also found a piece of code that caused the bullet to become more elastic. These two changes to the pre existing script gave me the ricochet effect I was looking for.
In Bob the Blob, part of the game was to allow you to control your character. Scaling allowed the character to get in and out of locations that he could otherwise not reach. The player was able to do this by pushing the scale key. Running into certain objects also triggered this transformation. Coding something like this in Torquescript seems deceptively simple. Since Torque is a
server based game engine. I had to communicate to the server and the client to change the player model. Transforming the character not only changes the model, but it also changes the player object’s properties. When the player is bigger he is heavier and harder to push with the physical zones. When the player is lighter, he moves faster and is more buoyant in water. Torques physics is a very powerful tool that is simple to implement.