Game Development Reference
In-Depth Information
CHAPTER 6
The Foundation of Game Design:
The JavaFX Scene Graph and
the InvinciBagel Game Infra-
structure
In this chapter, you will start to design the infrastructure of your InvinciBagel game,
both from the
user interface
(UI) and
user experience
standpoint as well as from the
“under the hood”
game engine
,
sprite engine
,
collision engine
, and
physics engine
standpoint. You will keep optimization in mind, as you must do as you work through the
rest of the topic, so that you do not get a
scene graph
that is so extensive or complicated
that the
pulse
system cannot update everything efficiently. This means keeping primary
game UI screens (
Scene
or
SubScene nodes
) to a minimum (three or four); making sure
that the 3D and Media engine (digital audio and digital video) use their own threads; and
checking that the functional “engines” that drive the game are all coded logically, using
their own classes and proper Java 8 programming conventions, structures, variables,
constants, and modifiers (see
Chapter 3
).
First, you will learn about the
top-level
,
front-facing
UI screen design that your
game will offer the user, including the InvinciBagel “branding” splash screen he or she
sees when launching the application. This screen will have Button controls on it, access-
ing other information screens, which you will want to minimize in number, as they will
be either Scene nodes (primary game play screen) or ImageView nodes (the other in-
formation screens). These game support screens will contain things that the user needs
to know to play the game effectively, such as game instructions and a high scores screen.
You will also include a legal disclaimers screen (to keep your legal department happy),