Nachdem ich mit Kreisen verschiedene Figuren konstruieren sollte, soll ich nun mit einem sich bewegenden Kreis eine Raupe darstellen.
Wenn ich nun aber auf die Methode move() zugreifen will kriege ich beim kompilieren eine Fehlermeldung("cannot find symbol")
Für diese Aufgabe wurde mir die Klasse circle.java(im Anhang als Textdokument da die java datei nicht hochgeladen werden kann) bereitgestellt.
Die Raupe komplett zu bilden wäre kein Problem aber iwie komme ich nicht dahinter wie ich die move Methode anwenden soll.
hoffe ihr könnt mir hier helfen
public class MainCaterpillar {
/**
* Creates and draws five custom designed circles,
*
*
* For this, the parameterized constructor of class
* Circle is used. It expects four parameters
* (in given order):
* radius, x coordinate, y coordinate (of type int)
* colour (of enumeration type Colour)
*
* @param args
*/
public static void main(String[] args) {
Circle circleFace = new Circle(10, 450, 300, Colour.YELLOW);
circleFace.draw();
CircleFace.move(35, 15);
}
}
In der vorherigen Aufgabe hat zumindest das zeichnen der Kreise funktioniert:
public class MainSmiley {
/**
* Creates and draws five custom designed circles,
*
*
* For this, the parameterized constructor of class
* Circle is used. It expects four parameters
* (in given order):
* radius, x coordinate, y coordinate (of type int)
* colour (of enumeration type Colour)
*
* @param args
*/
public static void main(String[] args) {
// Create circles Face,Mouth,Mouth2,LeftEye, RightEye
Circle circleFace = new Circle(250, 0, 0, Colour.YELLOW);
circleFace.draw();
Circle circleMouth = new Circle(150, 100, 100, Colour.BLACK);
circleMouth.draw();
Circle circleMouth2 = new Circle(150, 100, 80, Colour.YELLOW);
circleMouth2.draw();
Circle circleLeftEye = new Circle(50, 100, 75, Colour.BLACK);
circleLeftEye.draw();
Circle circleRightEye = new Circle(50, 300, 75, Colour.BLACK);
circleRightEye.draw();
}
}
Anhang1: Klasse Circle
Anhang2 vorherige Aufgabe in der man Kreise zeichnen sollte die einen Smiley bilden
Wenn ich nun aber auf die Methode move() zugreifen will kriege ich beim kompilieren eine Fehlermeldung("cannot find symbol")
Für diese Aufgabe wurde mir die Klasse circle.java(im Anhang als Textdokument da die java datei nicht hochgeladen werden kann) bereitgestellt.
Die Raupe komplett zu bilden wäre kein Problem aber iwie komme ich nicht dahinter wie ich die move Methode anwenden soll.
hoffe ihr könnt mir hier helfen
public class MainCaterpillar {
/**
* Creates and draws five custom designed circles,
*
*
* For this, the parameterized constructor of class
* Circle is used. It expects four parameters
* (in given order):
* radius, x coordinate, y coordinate (of type int)
* colour (of enumeration type Colour)
*
* @param args
*/
public static void main(String[] args) {
Circle circleFace = new Circle(10, 450, 300, Colour.YELLOW);
circleFace.draw();
CircleFace.move(35, 15);
}
}
In der vorherigen Aufgabe hat zumindest das zeichnen der Kreise funktioniert:
public class MainSmiley {
/**
* Creates and draws five custom designed circles,
*
*
* For this, the parameterized constructor of class
* Circle is used. It expects four parameters
* (in given order):
* radius, x coordinate, y coordinate (of type int)
* colour (of enumeration type Colour)
*
* @param args
*/
public static void main(String[] args) {
// Create circles Face,Mouth,Mouth2,LeftEye, RightEye
Circle circleFace = new Circle(250, 0, 0, Colour.YELLOW);
circleFace.draw();
Circle circleMouth = new Circle(150, 100, 100, Colour.BLACK);
circleMouth.draw();
Circle circleMouth2 = new Circle(150, 100, 80, Colour.YELLOW);
circleMouth2.draw();
Circle circleLeftEye = new Circle(50, 100, 75, Colour.BLACK);
circleLeftEye.draw();
Circle circleRightEye = new Circle(50, 300, 75, Colour.BLACK);
circleRightEye.draw();
}
}
Anhang1: Klasse Circle
Anhang2 vorherige Aufgabe in der man Kreise zeichnen sollte die einen Smiley bilden
Anhänge
Zuletzt bearbeitet: