Game Development Reference
In-Depth Information
variables iX and iY . Make all of these protected , so that any subclasses can access
them, as is shown in Figure 8-4 . You'll need to use the Alt-Enter work process for the
red error underlining relating to the import statements you will need for the List class
(object), ArrayList class (object), Image class (object), ImageView class (object), and
SVGPath class (object). Once NetBeans writes these for you, the dozen or so lines of
code declaring the List<Image> ArrayList, spriteFrame ImageView, SVGPath collision
Shape object and double variables containing the sprite's X and Y location should look
like the following Java class structure:
package invincibagel;
import java.util.ArrayList;
import java.util.List;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.shape.SVGPath;
public abstract class Actor {
protected List<Image> imageStates = new ArrayList<>();
protected ImageView spriteFrame ;
protected SVGPath spriteBound ;
protected double iX ;
protected double iY ;
}
 
 
Search WWH ::




Custom Search