Game Development Reference
In-Depth Information
Figure 16-36
.
Investigate red error highlight under the Scene Graph root StackPane object reference in the method
call
Mouse-over the warning highlighting, and you will see that NetBeans sees that we
are passing our custom Actor object to the .getChildren().remove() method chain, in-
stead of the ImageView Node object. The error message also tells us that the
private
StackPane root;
declaration in our
InvinciBagel.java
class will not allow us to
access this object, until we remove this
private
access control modifier keyword. Let's
fix the most serious (error) problem first, and then fix the “Suspicious method call to
java.util.Collection.remove” after that by using an
object.getSpriteFrame()
method
call, inside of the current .remove() method call.
Click on the InvinciBagel.java editing tab in NetBeans and remove the
private
keyword from the front of the
StackPane root;
object declaration, as is shown
highlighted in
Figure 16-37
.