public class SceneElementLayered extends SceneElement { /** * The coordinates for this element **/ private int x, y; /** * Make a new element with a picture as input, and * next as null, to be drawn at given x,y * @param heldPic Picture for element to hold * @param xpos x position desired for element * @param ypos y position desired for element **/ public SceneElementLayered(Picture heldPic, int xpos, int ypos){ myPic = heldPic; next = null; x = xpos; y = ypos; } /** * Method to draw from this picture. * @param pen Turtle to draw with **/ public void drawWith(Turtle pen) { // We just ignore the pen's position pen.moveTo(x,y); pen.drop(this.getPicture()); } }