<< 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 .

What is a game engine?

The term "game engine" is jargon for something that is more properly called a "software framework."

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 :

  1. inversion of control - In a framework, unlike in libraries or normal user applications, the overall program's flow of control is not dictated by the caller, but by the framework.
  2. default behavior - A framework has a default behavior. This default behavior must actually be some useful behavior and not a series of no-ops.
  3. extensibility - A framework can be extended by the user by selective overriding of framework code in order to provide specific functionality
  4. non-modifiable framework code - The framework code, in general should not normally be modified by the user. Users can extend the framework, butnormally should not modify its code.

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.

Background information

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.

Questions & Answers

Black market what is the meaning
Bless Reply
where there is illegal transactions of goods or services. where there illegal goods or services are sold.
Azhar
Scarcity is the major problem of any economy which is the limited resources an economy has in order to produce its country's unlimited wants/needs. Therefore, scarcity is the key term beyond the study of Economics.
Bature Reply
what is supply
Rahul Reply
Like the demand, the supply demonstrates the quantities that will be  sold at a certain price. But unlike the demand, the supply relationship  shows an upward slope. This means that the higher the price, the higher the  quantity supplied.  Producers supply more at a higher
Nazneen
or we can say that By supply we mean various quantatirs of a commodity which a producer will offer for sale at different possible prices over a given period of time
Nazneen
What is scarcity?
Jubille Reply
having unlimited needs and wants in a world of limited resources
William
what are the indicator of over population
Accorobatic Reply
Inefficiency of natural resources
Adekunle
Low PCI .
abhinav
resources are limited and wants are unlimited
Nazneen
limited resources
Nazneen
what product market?
Gayflor Reply
explain demand
Bless Reply
what is economics
Murali
Economics is the social science that studies the production, distribution and consumption of goods and services.Economics focuses on the behaviour and interactions of economic agents and how economies work.
Preeti
ok
SAGAR
Pls what is national income?
Ishmael
demand is the number of buyers. as the price of goods is increase, the buyers will not consider to buy the goods, so the demand will decreases
Pung
National Income is the aggregate monetary value of all final goods and services produced in an economy in an year .
abhinav
Why pecularities of land has no economic significance, What the economic bad, effictive demand?
James
Demand is a quantity of goods that a consumer is willing to buy at different prices over a given period of time
Nazneen
Define law of demand
Nazneen
what is deadweightloss
francis Reply
hi
Bless
deadweight loss is the allocative inefficiency.... when the equilibrium for good or services is not achived.
Azhar
hi
Azhar
hi
azaloo
hii too
Jackson
Hello
Micah
how are you all?
Azhar
I am here been sick but here
Amanda
may you get well soon Amanda
Azhar
What are the implications of classical Economics?
Micah
What are the implications of classical Economics school of thought?
Micah
Dead weight loss is an inefficient allocation of resources, especially through taxation or restrictions.
Ezeigwe
Classical Economics had an influenced by ancient economic principle and theory.
Ezeigwe
yec
Yasinta
nice
Amanda
hello please what is localization of industry
Bless Reply
price is tantalisingly the only factor determining demand which can be analyze the view
Sinit Reply
Price is tantalizingly the only factor determining demand which can be analyze the view
Sinit
what is scarcity
Sharkdanny Reply
the state of being scarce or in short supply; shortage.
Abdirahin
what is meant by an abnormal demand curve?
Samuel Reply
what is microeconomics
Berun Reply
micronomics can be define as that part of Economics that deals with small scale business. e.g. House hold stuff
Amodu
Micro economics is the study of individuals, households and firms' behavior un decision making and allocation of resources
Christian
what is underemployment
Xornam Reply
It is the situation where the available resources are not used to it optimum
Bless
state the law of diminishing returns
Bless
Bless, the law of diminishing returns state that one point, adding a single worker will result in a decrease of production.
David
it is a situation where by people are employ but work under their potential
Akua
David please go into details kk
Bless
Akua pls when you say people alone? what about facilities?
Bless
Definition of underemployment. 1 : the condition in which people in a labor force are employed at less than full-time or regular jobs or at jobs inadequate with respect to their training or economic needs
Boahen
OK that is good
Set
I am new here
Taimoor
what does law of demand says?
Samuel
with a diagram explain fairy elastic demand
Samuel
comprehensive answer for public finance is the money that a government has available to spend from taxes and borrowing.
wilflay Reply
what then comprises of public opinion
Raphael
what's the easiest and fastest way to the synthesize AgNP?
Damian Reply
China
Cied
types of nano material
abeetha Reply
I start with an easy one. carbon nanotubes woven into a long filament like a string
Porter
many many of nanotubes
Porter
what is the k.e before it land
Yasmin
what is the function of carbon nanotubes?
Cesar
I'm interested in nanotube
Uday
what is nanomaterials​ and their applications of sensors.
Ramkumar Reply
what is nano technology
Sravani Reply
what is system testing?
AMJAD
preparation of nanomaterial
Victor Reply
Yes, Nanotechnology has a very fast field of applications and their is always something new to do with it...
Himanshu Reply
good afternoon madam
AMJAD
what is system testing
AMJAD
what is the application of nanotechnology?
Stotaw
In this morden time nanotechnology used in many field . 1-Electronics-manufacturad IC ,RAM,MRAM,solar panel etc 2-Helth and Medical-Nanomedicine,Drug Dilivery for cancer treatment etc 3- Atomobile -MEMS, Coating on car etc. and may other field for details you can check at Google
Azam
anybody can imagine what will be happen after 100 years from now in nano tech world
Prasenjit
after 100 year this will be not nanotechnology maybe this technology name will be change . maybe aftet 100 year . we work on electron lable practically about its properties and behaviour by the different instruments
Azam
name doesn't matter , whatever it will be change... I'm taking about effect on circumstances of the microscopic world
Prasenjit
how hard could it be to apply nanotechnology against viral infections such HIV or Ebola?
Damian
silver nanoparticles could handle the job?
Damian
not now but maybe in future only AgNP maybe any other nanomaterials
Azam
Hello
Uday
I'm interested in Nanotube
Uday
this technology will not going on for the long time , so I'm thinking about femtotechnology 10^-15
Prasenjit
can nanotechnology change the direction of the face of the world
Prasenjit Reply
At high concentrations (>0.01 M), the relation between absorptivity coefficient and absorbance is no longer linear. This is due to the electrostatic interactions between the quantum dots in close proximity. If the concentration of the solution is high, another effect that is seen is the scattering of light from the large number of quantum dots. This assumption only works at low concentrations of the analyte. Presence of stray light.
Ali Reply
the Beer law works very well for dilute solutions but fails for very high concentrations. why?
bamidele Reply
Got questions? Join the online conversation and get instant answers!
QuizOver.com Reply

Get the best Algebra and trigonometry course in your pocket!





Source:  OpenStax, Anatomy of a game engine. OpenStax CNX. Feb 07, 2013 Download for free at https://legacy.cnx.org/content/col11489/1.13
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Anatomy of a game engine' conversation and receive update notifications?

Ask