Game Development Reference
In-Depth Information
text-based adventures and they described the game world in text form. The player
could then enter commands to interact with the game world such as 'go west', 'pick
up matches', or 'Xyzzy'. Examples of such early games are Zork and Adventure.
Although they might seem dated now, these games are still a lot of fun to play!
It is still possible to write console applications in a modern language like C#:
you can find an example of such an application (called HelloWorld )inthesamples
provided with this chapter. Although it is interesting to see how to write such appli-
cations, we prefer to focus on programming more modern games with graphics.
3.3.2 Other Types of Applications
The console application is only one example of a type of application that exists.
Another very common type is the Windows application. This application shows a
screen containing windows, buttons, and other parts of a graphical user interface
(GUI). This type of application is often event-driven : it reacts to events such as
clicking a button or selecting a menu item.
Another type of application is the web application ,or applet . In this case, the
program is stored on a server and the user runs the program in a web browser. There
are many examples of such applications, think of web-based email programs or
social network sites.
Yet another type is the app . This kind of application is run on a mobile phone
or a tablet PC. Screen space is generally limited in these type of applications, but
new interaction possibilities are available such as GPS to find out the location of the
device, sensors that detect the orientation of the device, and a touch screen.
Finally, we have the Game application. A game is a graphical application, but
with fast-moving images, and can be run on specialized hardware such as a game
console or a mobile device (then it becomes a game app). Games often use a con-
troller made specifically for the hardware, or the touch screen in the case of game
apps. For a console application the keyboard is the most important interaction de-
vice, for games it generally plays a limited role (if it is used at all).
3.3.3 A Method: A Group of Instructions with a Name
Remember that in an imperative program the instructions are doing the actual job
of the program: they are executed one after the other. This changes the memory
and/or the screen, so that the user notices that the program is doing something. In
the BasicGame program, not all lines in the program are actually instructions. One
example of an instruction is the line GraphicsDevice.Clear(Color.Olive); which instructs
the graphics device to clear the background and give it a color.
Because C# is a procedural language, the instructions are grouped in methods .
Even though there are only a few instructions in our BasicGame program, we are
Search WWH ::




Custom Search