<< Chapter < Page | Chapter >> Page > |
You will learn how to write a minimal Java application in conjunction with a set of Slick2D jar files to create your own Slick2D game engine. Using that programas an example, you will learn about the overall structure of the Slick2D game engine.
You will learn that game engines are typically service provider programs and you will learn about a common set of services that is provided bymany game engines.
You will learn about the two cooperating objects that form the heart of the Slick2D game engine.
You will learn about the methods declared in the interface named Game .
The term "game engine" is jargon for something that is more properly called a "software framework."
Here is part of what Wikipedia has to say about a software framework:
A software framework , in computer programming, is an abstraction in which common code providing generic functionality can be selectively overridden or specialized by user code providing specific functionality .
Frameworks are a special case of software libraries in that they are reusable abstractions of code wrapped in a well-defined API, yet they contain some key distinguishing features that separate them from normal libraries.
Software frameworks have these distinguishing features that separate them from libraries or normal user applications :
In short, a framework is a computer program that helps you to write computer programs.
Not a game engine
Under this definition, Slick2D in its raw form is not a game engine nor is it a framework. Instead, it is a library of Java classes that you can use to create aframework or game engine.
In particular, if you combine the contents of the files named slick.jar and lwjgl.jar with the minimal Java application shown in Listing 1 and described in Figure 1 , you will have created a game engine. That combination is what I will refer to hereafter as the Slick2D game engine .
Having done that, the framework description given above is a good match for the Slick2D game engine.
Listing 1 shows a very simple Java application program.This is possibly the simplest program that can be written using Slick2D that will run as a Java application.
(A different approach is used to create a Slick2D program that will run as a Java applet, but I probably won't get into Java applets in this collection ofmodules.)
I will use this program to explain the overall structure of the Slick2D game engine in this module. I will explain the inner workings of the game engine in more detail infuture modules.
Notification Switch
Would you like to follow the 'Anatomy of a game engine' conversation and receive update notifications?