Game Development Reference
In-Depth Information
Treasure
iTR0
,
iTR1
; // These Object Declarations go
at the top of the InvinciBagel class
private Image iB0, iB1, iB2, iB3, iB4, iB5, iB6, iB7,
iB8, iP0, iP1,
iT0
,
iT1
;
iT0
= new Image("
/treasure1.png
", 64, 64, true, false,
true); //
.loadImageAssets()
Method
iT1
= new Image("
/treasure2.png
", 64, 64, true, false,
true);
iTR0
= new Treasure("M0 0 L0 64 64 64 64 0 Z",
50
,
105
,
iT0); //
.createGameActors()
Method
iTR1
= new Treasure("M0 0 L0 64 64 64 64 0 Z",
533
,
206
,
iT1);
root.getChildren().add(
iTR0
.spriteFrame);
root.getChildren().add(
iTR1
.spriteFrame);
Figure 17-14
.
After adding declarations at the top of the class, instantiate the objects, and add them to a Scene Graph
Let's take a moment and use a
Run
Project
work process and see if our Treas-
ure Actors are on the screen!