Game Development Reference
In-Depth Information
Chapter 2
Programming
2.1 Introduction
Generally speaking, a computer is quite stupid. It can only do exactly what you tell
it to do. The only reason that modern computers and game consoles can do what
they do, is that programmers have provided an extremely long list of very precise
instructions that describe each task the computer should perform in detail. So, if
you want to make your own game, there is no way around it: you are going to have
to provide a long list of specific instructions that explains exactly what your game
should do. Furthermore, the computer is even stricter than your teachers at school:
one grammatical error and the game will not work. To make it even worse, you
cannot even use your native language to provide these instructions! Obviously it
would be nice if we could write down the following text, and the computer would
simply run a game that does exactly what is written down:
Draw a castle on a screen.
Put a monster in the castle.
As soon as the player walks into the castle, the monster attacks.
Unfortunately, the computer does not understand this. The English language (or
any natural language for that matter) is not very suitable to tell the computer what
should be done, because natural languages often lack precision. To illustrate this,
have a look again at the text we have just written. We first tell the computer to draw
a castle on the screen. Where should this castle be drawn? Does it have towers, or
flags, or both? Is it made of stone or some other material? Where is the entrance?
The same goes for the other two lines of text. Where in the castle should we put the
monster? How many heads does the monster have? How does the monster attack the
player? It is clear that we need to be very precise when making our game, otherwise
the result might not be what we expect.
But do not be discouraged! Once you have learned to deal with these issues,
programming games can be even more fun than playing them. But before we get
started with that, let us first have a look at how a computer or a game console works.
 
Search WWH ::




Custom Search