Game Development Reference
In-Depth Information
public static
Animation
bobJump
;
public static
Animation
bobFall
;
public static
TextureRegion
bobHit
;
public static
Animation
squirrelFly
;
public static
TextureRegion
platform
;
public static
Animation
brakingPlatform
;
public static
Font
font
;
public static
Music
music
;
public static
Sound
jumpSound
;
public static
Sound
highJumpSound
;
public static
Sound
hitSound
;
public static
Sound
coinSound
;
public static
Sound
clickSound
;
The class holds references to all the
Texture
,
TextureRegion
,
Animation(0.2f,
,
Music
, and
Sound
instances we need throughout our game. The only thing we don't load here are the images for
the help screens.
public static void
load(GLGame game) {
background
=
new
Texture(game, "background.png");
backgroundRegion
=
new
TextureRegion(
background
, 0, 0, 320, 480);
items
=
new
Texture(game, "items.png");
mainMenu
=
new
TextureRegion(
items
, 0, 224, 300, 110);
pauseMenu
=
new
TextureRegion(
items
, 224, 128, 192, 96);
ready
=
new
TextureRegion(
items
, 320, 224, 192, 32);
gameOver
=
new
TextureRegion(
items
, 352, 256, 160, 96);
highScoresRegion
=
new
TextureRegion(Assets.
items
, 0, 257, 300, 110 / 3);
logo
=
new
TextureRegion(
items
, 0, 352, 274, 142);
soundOff
=
new
TextureRegion(
items
, 0, 0, 64, 64);
soundOn
=
new
TextureRegion(
items
, 64, 0, 64, 64);
arrow
=
new
TextureRegion(
items
, 0, 64, 64, 64);
pause
=
new
TextureRegion(
items
, 64, 64, 64, 64);
spring
=
new
TextureRegion(
items
, 128, 0, 32, 32);
castle
=
new
TextureRegion(
items
, 128, 64, 64, 64);
coinAnim
=
new
Animation(0.2f,
new
TextureRegion(
items
, 128, 32, 32, 32),
new
TextureRegion(
items
, 160, 32, 32, 32),
new
TextureRegion(
items
, 192, 32, 32, 32),
new
TextureRegion(
items
, 160, 32, 32, 32));
bobJump
=
new
Animation(0.2f,
new
TextureRegion(
items
, 0, 128, 32, 32),
new
TextureRegion(
items
, 32, 128, 32, 32));
bobFall
=
new
Animation(0.2f,
new
TextureRegion(
items
, 64, 128, 32, 32),
new
TextureRegion(
items
, 96, 128, 32, 32));
bobHit
=
new
TextureRegion(
items
, 128, 128, 32, 32);
squirrelFly
=
new
Animation(0.2f,