This is a rough bit of pseudo code I created about a year and a half ago for a 3D Astroid's game I was making for my own education.
Make a score integer
Make a lives integer
Usual initialisation, turn off the autocam, set resolution to 1024 by 768.
Make a camera, call it number one.
Make a skycube, call it number one, make it very large to cover whole game area.
Load the cube texture file and call it cube texture image, call it number one.
Apply the texture to cube then cull to make insides show.
Load a new model object, this is the player it is number 2
Make an astroid object array of 500.
Load 500 astroids and assign each object to array, randomly place astroid's within the sky cube. Use a FOR and NEXT loop.
Randomize the rotation of each astroid.
Load a new player model.
Check that player model does not clash with astroid model if it does, make program move object 10 units as often as needed until player model has cleared astroid by at least 100 units.
Set lives to 3
Set score to 0
Begin the DO and LOOP cycle.
Setup keys for both player and camera object rotation, pitch, roll, rotate, set speed at around 0.2.
Setup keys for accelleration and decelleration. Make a function to handle this. Set the maxium speed at around 1.2 or 2., experiment to see.
Update the camera location to the players location, then move forward by 3 units.
if space bar is pressed, spontainiously make a sphere, streach it by three times, place it in the gun barrel, and then set the object to move at a speed of 10. Create a function to do this. As well as an update function to keep all bullet objects moving. Maximum of 10 on the screen at once. Make sure the bullet can not move futher than 500 units, if it does then remove it.
If the tab key is pressed, accellerate the player object to three times maximum speed.
Check to see if bullets fired have collided with an astroid. IF it has, call a function that hides this astroid object, and makes an explosion graphic. Also add 10 points to player score.
Check to see if an astroid has hit the player ship, if it has, then subtract 1 from lives and make explosion graphics. Check to see if the lives are below 0, if they are then end the game, if they are not then when explosion has finished, move the player to middle of game zone. Check that the player object is not in contact with an astroid, if it is, then move the player 10 units until the ship is 100 units clear to the atroid, and repeat check.
Move all astroid's by 1 unit every cycle, the randomized rotation will do the rest.
end the DO and LOOP.
Add the functions after the loop command.
So basically it's just a way of listing what needs to be done in the whole program. I can then work along the list, and turn it onto real life code.
I lay upon my bed one bright clear night, and gazed upon the distant stars far above, then I thought... where the hell is my roof?