Game Development Reference
In-Depth Information
The Structure of a Program
This section talks about the structure of a program in more detail. In the early days, many computer
programs only wrote text to the screen and didn't use graphics. Such a text-based application is
called a console application. In addition to printing text to the screen, these applications could also
read text that a user entered on the keyboard. So, any communication with the user was done in the
form of question/answer sequences ( Do you want to format the hard drive (Y/N)? Are you sure
(Y/N)? and so on). Before Windows-based OSs became popular, this text-based interface was very
common for text-editing programs, spreadsheets, math applications, and even games. These games
were called 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,
they're still fun to play!
It's still possible to write console applications, also in a language such as JavaScript. Although it's
interesting to see how to write such applications, I prefer to focus on programming modern games
with graphics.
Types of Applications
The console application is only one example of a type of application. Another very common type is
the Windows application. Such an 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 app , 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.
When developing applications, it's quite a challenge to write a program that works on all the different
platforms. Creating a Windows application is very different from creating an app. And reusing the
code between different types of applications is difficult. For that reason, web-based applications
are becoming more popular. In this case, the application 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 e-mail
programs or social network sites. And in this topic, you learn how to develop web-based games .
Note Not all programs fall squarely in one application type. Some Windows applications might have
a console component, such as the JavaScript console in a browser. Games often also have a window
component, such as an inventory screen, a configuration menu, and so on. And nowadays the limit of what
a program actually is has become less clear. Think about a multiplayer game that has tens of thousands of
players, each running an app on a tablet or an application on a desktop computer, while these programs
communicate with a complex program running simultaneously on many servers. What constitutes the
program in this case? And what type of program is it?
 
 
Search WWH ::




Custom Search