Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
epoxy
GitHub Repository: epoxy/proj11
Path: blob/master/SLICK_HOME/src/org/newdawn/slick/Game.java
1456 views
1
package org.newdawn.slick;
2
3
/**
4
* The main game interface that should be implemented by any game being developed
5
* using the container system. There will be some utility type sub-classes as development
6
* continues.
7
*
8
* @see org.newdawn.slick.BasicGame
9
*
10
* @author kevin
11
*/
12
public interface Game {
13
/**
14
* Initialise the game. This can be used to load static resources. It's called
15
* before the game loop starts
16
*
17
* @param container The container holding the game
18
* @throws SlickException Throw to indicate an internal error
19
*/
20
public void init(GameContainer container) throws SlickException;
21
22
/**
23
* Update the game logic here. No rendering should take place in this method
24
* though it won't do any harm.
25
*
26
* @param container The container holing this game
27
* @param delta The amount of time thats passed since last update in milliseconds
28
* @throws SlickException Throw to indicate an internal error
29
*/
30
public void update(GameContainer container, int delta) throws SlickException;
31
32
/**
33
* Render the game's screen here.
34
*
35
* @param container The container holing this game
36
* @param g The graphics context that can be used to render. However, normal rendering
37
* routines can also be used.
38
* @throws SlickException Throw to indicate a internal error
39
*/
40
public void render(GameContainer container, Graphics g) throws SlickException;
41
42
/**
43
* Notification that a game close has been requested
44
*
45
* @return True if the game should close
46
*/
47
public boolean closeRequested();
48
49
/**
50
* Get the title of this game
51
*
52
* @return The title of the game
53
*/
54
public String getTitle();
55
}
56
57