Left Bracjet HomeCreations Right Bracket
The GamerOther
Programming
Space Invaders 3d
Space Invaders I made this game for my graphics class final project. This was the first game I made with my newly found knowledge of OpenGL (at the time).
   
The invaders have their standard animation, and the models were made from scratch using gl_polygon. Just for the invader model in both animations took about 8 hours.
   
Here you can see how the camera tilts based on the location of the player. It feels a little jumpy on a keyboard, but I decided to throw in analog controller support, which looks way smoother.
   
The standard attack from space invaders. Here you can see the collision in effect, and the particle physics I included for the explosion of the space invaders.
   
Here you can see 2 more attacks, based on retro gaming style weapons. The blue laser beams, 3 beams, one going straight, the other 2 at perfect 45 degree angles. And the purple wave attack, which spray in a random arc for massive overwhelming damage, but are far slower than other attacks. The attacks have cooldowns(only on analog controller, the keyboard input became "for testing only" once I got the analog controller working), and the structure for an ammo system.
   
I felt making a game 3d but not taking advantage of that in any other way than graphically would have been gimmicky, so I added the red bomb attack. It shoots a spray into the Z dimension, and falls down onto the invaders, omitting the first line of invaders to kill the ones behind it. Which also means that collision works in the third dimension. This could have been used to jump over the defensive structures.
   

Like any real retro game I decided this needed a superweapon. Codenamed "The Cube." A slow moving block that can destroy multiple invaders.
   

That was all that I finished for this game. I was working out the logistics for how to get the aliens to move, especially for when a row on the sides was destroyed, when I had to hand it in, and immediately had to start working on the capstone final project.

Coded in: C++
Libraries used: OpenGL, with GLUT.

Download: Here
Requires C++ 2010 redistrubtion avalible here.

Controls: This game was designed for analog controller input, left analog thumbstick controls movement, and the 4 main buttons control the 4 attack types, pressing the left thumbstick down uses the superweapon. Keyboard input still works, but it's really just for debugging purposes, A and D or left and right arrow keys move left and right, zxcvbnmlk all control the attacks, some of which are the same attack shooting multiple instances, e resets the field. Keyboard input is unbuffered and doesn't support cooldowns.

Disclaimer: This is still an alpha tech demo, the lighting is a little messed up and not much works, please do not judge it too harshy. I take no responsibility for what this may do to your computer. However small the odds might be, there might always be something I didn't consider when coding it. Downloader beware.

Space Invaders is property of Midway. This is simply a tech demo and homage to one of the greatest games ever made. I never intended on selling it.

Youtube video: ouAKx74M1yU

   
Crosshair
Intro Pic A first person shooter designed as my final project. My greatest work currently. The graphics aren't amazing, it wasn't the focus of this project, the focus was the physics. When we were deciding what to do for our final projects I told a teacher I had decided to do a first person shooter. He called me insane, and said I should just work on space invaders. I told him I had already learned everything I could from space invaders. I went into this project deciding simple things like "I want to use a heightmap" just so I could figure out how a heightmap works. What an insane amount of work I had thrown into my lap; but I ended up learning everything I wanted to learn, so I don't regret it for a second. Keep in mind, this project took far more work than space invaders 3d, but at the same time it's harder to represent this work in pictures, since most of it is in pure code.
   
The game sports full ballistic physics, across 4 weapons. Each one has real-world gun specifications such as scope magnification, bullet exit velocity, and rate of fire. The rotations of the player are done with a simple 180 by 360 degree coordinate system. You can also notice in this picture that I have working textures, done with the DevIL (also known as OpenIL) library.
   
Here you can see the random generation system for the heightmap. It can generate anything from rough peaks, to flat ground, and completely dry to covered in water. The player is capable of swimming through the water at a vastly decreased speed (bottom right). You can also see in the top right picture that the light is different, I set the game to have different lighting conditions, which right now only looks like sunny or overcast, but can also be expanded to include things like dusk, dawn, and night.
   
The gameplay is simple enough. 10 of these placeholder model blocks are spawned, and you have to shoot all of them. The blocks turn red when shot, which is a placeholder for the model death animation. Based on your accuracy and the time it took you your score is decided. You can see here the option to save the map or quit. I'll expand on this in the next picture.
   
While in college I realized I kept writing argc and argv without really knowing what it could do or how I could use it. I decided to read into it, and come up with a way to use it for my project; I decided to use it to load heightmaps. Here you can see a standard 30x30 heightmap, with numbers 0 to 9, drag and drop any file following those rules onto the exe and it loads into the game! If the file is smaller than 30x30 it'll randomly generate a new map, and if it's bigger it'll parse the first 30x30 of the map. If you liked the random map you played on, you can simply hit save, type a name of up to 15 characters, and play it later.
   
All of this pales in comparison to the ability to stand on the heightmap. It's broken down into 3 possibilities. Either the player is standing on a point, which is easy, on an edge, which is a little harder, or on a face. The face is the most complicated. It's broken down further into 2 parts of the face, either the top right half, or the bottom left half. I then took the 3 points that made up the face, and obtained their cross product to get a face normal for the plane. I then shot a ray down from a height of 10(above the maximum, but any height between 9.0001 and infinite would have done), and calculated where it hits the plane. And so my player can glide effortlessly over the heightmap.

No picture can show the height map system in action any better than the other pictures I have here, so this is the first portion of the face collision. Check out the video at the bottom to see it in action.
   

The game also supports audio. The bullets make a sound, reloading makes a sound, and the collisions make a sound, all done through OpenAL.

Coded in: C++

Libraries used: OpenGL, with GLUT. OpenAL, with ALUT. DevIL. GLEW.

Download: Because of how I coded it the code isn't transferable at all. I'll see if I can get it together one of these days.

Youtube video (With annotations): BoB4kfEB9Qw

   
   
Copyright 2011 Konrad S.