Game Development Reference
In-Depth Information
A line without arrows designates a bidirectional relationship between two classes,
meaning that they depend on each other in order to work correctly. If there is a line
with a filled arrowhead at one end, it means that the class that points to the other
class needs it to work properly and not vice versa. On the other hand, if there is a line
with an unfilled arrowhead at one end, it always points from an implementing class
(specialization in UML) to its super class (generalization in UML), which can either
be an interface or an abstract class.
Lastly, there are numbers to describe the multiplicity or, in other words, how
many instances of an object will exist from one class in another. The syntax for
this is as follows:
0..1 : This indicates zero or one instance; the notation n..m indicates n to m
instances
0..* or * : This indicates that there is no limit to the number of instances
(including none)
1 : This indicates that there is exactly one instance
1..* : This indicates that there is at least one instance, but no limit to the
number above this
You should now be able to read the information in the class diagram.
At the top of the class diagram, you will see CanyonBunnyMain . It is the starter class
of the game and therefore necessarily needs to implement the ApplicationListener
interface provided by LibGDX. It holds a reference to an Assets class that will be
used to organize and simplify the way to access the game's assets. There are two
more references pointing to WorldController and WorldRenderer .
The WorldController class contains all the game logic to initialize and modify the
game world. It also needs access to CameraHelper —a helper class for the camera—
that, for example, enables it to target and follow any game object; Level that holds
the level data; and a list of AbstractGameObject instances representing any game
object that exists in the game world.
The rendering takes place in WorldRenderer that apparently also requires it to have
access to the list of the AbstractGameObject instances. As the game objects need to
be created before the process of modification and rendering, Level needs access to
the list of the AbstractGameObject instances as well when a level is loaded from a
level file at the beginning of the game.
 
Search WWH ::




Custom Search