Friday, 17 April 2015

Create A Video Game From Scratch

Create a Video Game From Scratch


Nearly everyone who has played a great video game has wondered how they are made and if they can make their own. Creating your own video game from scratch is an incredibly lofty goal, as you will need to thoroughly learn the ins and outs of a programming language and have the persistence to keep trying when the game doesn't work the way you want it to the first time around.


Instructions


1. Come up with a core mechanic for your game that players will spend most of their time utilizing, such as solving specific kinds of puzzles, shooting alien spaceships, or negotiating peace treaties between medieval kingdoms. Make a detailed list of every feature that you want the game to have and how those features will interact with each other. Think in terms both of how the features will look on the screen and how they will need to be coded behind the scenes.


2. Choose a programming language that offers object-oriented programming, such as C++, to make programming the various classes you will need for each object in the game much easier. Download a compiler program that interprets the code and displays the interpreted instructions on the screen (see Resources below).


3. Make a decision as to whether you want your game to use 2-D "sprites" or full 3-D polygonal objects, which will require much more programming knowledge. Decide if you have the time and dedication to create the art for the game or if you need to acquire art from another source. Download 3-D art packs from any of the various art vendors on the internet or instead purchase a program such as 3-D Studio Max or Caligari TrueSpace and create your own 3-D images. Use an image-editing program with thousands of different color options, such as Adobe Photoshop, if you want to make your own 2-D images.


4. Familiarize yourself with the Windows Application Programing Interface (API) and first code out the instructions to create a new window where the action of the game will take place. Write out the C++ code to load your graphics files into the computer's memory and display them on the screen. Take advantage of the Windows API ability to "buffer" images if you are using 2-D images or the screen will display a distracting flicker each time an image moves or loads into memory. Code out a class to remove each image from the computer's memory when it is no longer needed and then call it each time an object is "destroyed," such as when an alien spaceship has exploded or a portion of the game map is no longer within sight.


5. Write a main game loop that will run as long as the game is still on. Have it check for the state of the game, such as if the player has pressed a button, what the current score is, and if the game needs to shut down.


6. Create the code for the rest of the game functions that will operate within the major game loop. Make a feature to save the status of all the objects in the game and then load them again when the player turns the game back on, a way for objects to move around, and a collision detection system so that the game knows what to do when images touch each other.


7. Choose whether you want to "hard code" each level into the game or if your game will be large enough that you need to use a scripting program or level editor to efficiently add new levels (see Resources below).


8. Choose the option in your compiler program to make the game into an executable file that can be ran by double-clicking on an icon. Run the executable and test for any bugs. Go back into your code, locate the coding errors causing the bugs, and fix them. Repeat this process until the game is stable and able to be played without any noticeable problems.


9. Use an installation program such as InstallShield to compress your game so that other people can download it and install it on their computers.

Tags: your game, will need, compiler program, computer memory, Create Video