I have two different files
One looks like:
import java.awt.Color;
public class GraffitiApp
{
public static void main(String[]a)
{
World wRef = new World();
ArtisticTurtle tRef = new ArtisticTurtle(wRef);
tRef.pentagon();
FileChooser.pickMediaPath();
Picture pRef;
pRef = new Picture(FileChooser.pickAFile());
pRef.explore();
Color purple = new Color(175, 0, 175);
Pixel pixRef;
pixRef = pRef.getPixel(340, 85);
pixRef.setColor(purple);
pixRef = pRef.getPixel(341, 85);
pixRef.setColor(purple);
pixRef = pRef.getPixel(342, 85);
pixRef.setColor(purple);
pixRef = pRef.getPixel(338, 85);
pixRef.setColor(purple);
pixRef = pRef.getPixel(339, 85);
pixRef.setColor(purple);
pixRef = pRef.getPixel(340, 84);
pixRef.setColor(purple);
pixRef = pRef.getPixel(340, 83);
pixRef.setColor(purple);
pixRef = pRef.getPixel(340, 86);
pixRef.setColor(purple);
pixRef = pRef.getPixel(340, 87);
pixRef.setColor(purple);
pRef.explore();
}
}
The other:
public class ArtisticTurtle extends Turtle
{
public ArtisticTurtle (Picture pRef)
{
super (pRef);
}
public static void main(String[]a)
{
World wRef = new World();
ArtisticTurtle tRef = new ArtisticTurtle(wRef);
tRef.pentagon();
}
public void pentagon()
{
this.forward( 20 );
this.turn( 72 );
this.forward( 20 );
this.turn( 72 );
this.forward( 20 );
this.turn( 72 );
this.forward( 20 );
this.turn( 72 );
this.forward( 20 );
this.turn( 72 );
this.penUp();
this.forward(100);
this.penDown();
this.forward(40);
}
public void spiral (int length)
{
this.forward( length );
length = length + length/5;
this.turn( 72 );
this.forward( length );
length = length + length/5;
this.turn( 72 );
this.forward( length );
length = length + length/5;
this.turn( 72 );
this.forward( length );
length = length + length/5;
this.turn( 72 );
}
public ArtisticTurtle(World wRef)
{
super(wRef);
}
}
The artistic turtle creates a world and moves around in it, the graffitiapp also opens the turtles world and moves him, along with bringing up two pictures, one with purple pixels the other without. turtle and world are both extra class paths i think, in case theres some confusion.
My problem is I need the turtle to draw on the picture with the pixels, not in its own world.
Anyone think they can help me out?