Game Development Reference
In-Depth Information
C is still used quite a lot, although it's slowly but surely making way for more modern languages,
especially in the game industry. Over the years, games became much larger programs, and they
were created by teams rather than individuals. It was important that the game code be readable,
reusable, and easy to debug. Also, from a financial perspective, reducing the time programmers had
to work on a game became more and more essential. Although C was a lot better in that respect
than the Assembler languages, it remained difficult to write very large programs in a structured way.
Object-Oriented Programming: Procedural + Objects
Procedural languages like C allow you to group instructions in procedures (also called methods ).
Just as they realized that instructions belonged together in groups, programmers saw that some
methods belonged together as well. The object-oriented paradigm lets programmers group methods
into something called a class . The memory that these groups of methods can change is called an
object . A class can describe something like the ghosts in a game of Pac-Man. Then each individual
ghost corresponds to an object of the class. This way of thinking about programming is powerful
when applied to games.
Everybody was already programming in C, so a new language was conceived that was much like
C, except that it let programmers use classes and objects. This language was called C++ (the two
plus signs indicated that it was a successor to C). The first version of C++ dates from 1978, and the
official standard appeared in 1981.
Although the language C++ is standard, C++ doesn't contain a standard way to write Windows-based
programs on different types of operating systems. Writing such a program on an Apple computer,
a Windows computer, or a Unix computer is a completely different task, which makes running C++
programs on different operating systems a complicated issue. Initially, this wasn't considered a
problem; but as the Internet became more popular, the ability to run the same program on different
operating systems was increasingly convenient.
The time was ripe for a new programming language: one that would be standardized for usage
on different operating systems. The language needed to be similar to C++, but it was also a nice
opportunity to remove some of the old C stuff from the language to simplify things. The language
Java fulfilled this role (Java is an Indonesian island famous for its coffee). Java was launched in 1995
by the hardware manufacturer Sun, which used a revolutionary business model for that time: the
software was free, and the company planned to make money via support. Also important for Sun
was the need to compete with the growing popularity of Microsoft software, which didn't run on the
Unix computers produced by Sun.
One of the novelties of Java was that the language was designed so programs couldn't accidentally
interfere with other programs running on the same computer. In C++, this was becoming a significant
problem: if such an error occurred, it could crash the entire computer, or worse—evil programmers
could introduce viruses and spyware.
Web Applications
One of the interesting aspects of Java was that it could be run in a browser as a so-called applet . This
yielded the possibility of sharing programs over the Internet. However, running a Java applet requires
the installation of a plug-in; and, furthermore, there is no straightforward possibility for the Java applet
to interact with the elements of a browser. Of course, the other main task of a browser is to display
 
Search WWH ::




Custom Search