Game Development Reference
In-Depth Information
2.6 Developing Games
2.6.1 Small Scale: Edit-Compile-Run
When we want to build a game, we need to write a program that contains many
lines of instructions. With Visual Studio, we can edit the source files in a project
and type instructions in them. Once we are done writing down these instructions,
the file containing the source code is inspected by the compiler. When all is well,
the compiler will create the intermediate code, and then an executable file , which is
our program in machine code.
However, most of the time, things will not be that easy. For one, the source code
that we give to the compiler should contain valid C# code, because we cannot ex-
pect the compiler to create an executable file from random blabbering. The compiler
checks whether the source code adheres to the language specifications of the C#
language. If not, it will produce an error and no code is generated. Of course, pro-
grammers will make an effort to compile a real C# program, but it is easy to make
a typo, and the rules for writing correct programs are very strict. So, you will most
certainly encounter these errors during the compilation phase.
After a few iterations of resolving these minor errors, the compiler will have
generated the intermediate code and the executable file. This means that it is time
for the next phase: executing (also called running ) the program. In many cases, you
will then discover that the program does not exactly do what you want it to do. Of
course, you made an effort to correctly express what you wanted the program to do,
but conceptual mistakes are easily made.
So you go back to the editor, and you change the program. Then, you compile it
(and hope you did not make new typing mistakes) and you run the program again
to see if the problem is solved, only to realize that the program is indeed doing
something different, but still not exactly what you want. And it is back to the editor
again ...Welcome to your life as a programmer!
2.6.2 Large Scale: Design-Specify-Implement
As soon as your game starts becoming more complicated, it is not such a good idea
anymore to just start typing away until you are done. Before you start implementing
(writing and testing the game), there are two other phases.
First, you will have to design the game. What type of game are you building?
Who is the intended audience of your game? Is it a 2D game or a 3D game? What
kind of gameplay would you like to model? What kinds of character are in the game,
and what are their capabilities? Especially when you are developing a game together
with other people, you are going to have to write some kind of design document
that contains all this information, so that everybody agrees on what game they are
actually developing! Even when you are developing a game on your own, it is a
Search WWH ::




Custom Search