In my last post, I constructed a 3D model of Nora Lamb in Blender with three skeletal animation states. With Nora imported into my C++ virtual reality engine (with OpenGL graphics library and the Oculus SDK for Windows), the mutton-to-be heroine was rendered to the Oculus Rift headset. She stood on the spot in heavy breathing. She shuffled across the virtual world. And she leapt into the air when my virtual hand slammed a big blue button, to avoid a fiery pit of death. Yet jump at the wrong time and Nora perished at the wrinkled warty old hand of a witch, flying through the night sky on a broomstick.
But now I want to add another character to the game, an enemy that will fire bullets at Nora. That enemy is “Crane-neck”, a large skeletal-animated bird that discharges lethal pellets from its arse.
Here’s a video of Nora suffering bullets, a witch and a fire pit before finally making it to the end of the game:
Notice how I need to herd Nora Lamb into a jog, by running behind her. Then I must make a frantic dash for the blue jump button, to slam it with my virtual hand and help Nora leap out of danger.
At first, I am too slow, and Nora takes a bullet to the legs. Next, I manage to hit the button in time, but only for Nora to jump into the witch. Each time she suffers, she is shunted back to the start, and I need to go herding her again.
Nora is hit again by a bullet from the bum of Crane-neck, and it’s game over. I hit the button for a new game.
Nora’s luck is not improving as she leaps too early and lands into the fiery pit of death. A bullet strikes again, to drop Nora to one life. But, finally, I slam the big blue button at the right times and Nora heroically leaps the fire pit and an oncoming bullet to successfully complete the level. Whew!
I’ve added a random time to the bullets being shat from the bird’s arse, to add a bit of spice. As before, a point light illuminates the scene.
I recorded a couple of chords on my Fender Stratocaster (Am, Abm, I think), with some chorus and delay, for the game over sound. My son’s mandolin playing, again with chorus and delay, provided the victory salute. The game start audio was recorded on my old Yamaha PSR-78 keyboard, distorting the volume to yield a retro computer game chip sound.
All 3D audio was delivered from the game engine to the Rift headset via FMOD.
Some other additions to the game involved:
- Axis-Aligned Bounding Box collision detection to prevent the VR player (that’s me) from wandering into Nora’s arena (or, indeed, wandering into the jump button). I added a nice little fence to mark the boundary.
- Number Of Lives count, to determine whether Nora completes the game or dies horribly. Text rendering code allowed me to print the remaining lives into the night sky (along with “Ready!”, “Level Completed!” and “Game Over!”).
- Finish Flag, for Nora to dash towards.
- Restart Game, which resets the lives to 3 so the fun can go on forever!
Next, I will create a new level. God knows what monsters will be shitting bullets on Level 2.