Hallo zusammen,
ich muss ein ein Pendel, dass hin und her schwingt, mithilfe von Java in Bluej erstellen. Leider funktioniert es nich und ich weiß nich warum![^^](https://www.easy-coding.de/wcf/images/smilies/grin.png)
könnt ihr mir sagen was ich falsch gemacht habe???
Alles anzeigen
ich hoffe ihr könnt mir helfen![:D](https://www.easy-coding.de/wcf/images/smilies/biggrin.png)
danke schonma im vorraus
Flav
// edit by vince - highlighting
ich muss ein ein Pendel, dass hin und her schwingt, mithilfe von Java in Bluej erstellen. Leider funktioniert es nich und ich weiß nich warum
![^^](https://www.easy-coding.de/wcf/images/smilies/grin.png)
könnt ihr mir sagen was ich falsch gemacht habe???
![?(](https://www.easy-coding.de/wcf/images/smilies/confused.png)
Quellcode
- import sum.kern.*;
- import sum.werkzeuge.*;
- /**
- * @author
- * @03.12.12
- */
- public class Pendel
- {
- // Objekte
- Bildschirm hatBildschirm;
- Maus hatMaus;
- Buntstift hatStift;
- Uhr hatUhr;
- int zWinkel;
- int zVWinkel;
- int zRichtung;
- // Konstruktor
- public Pendel()
- {
- hatBildschirm = new Bildschirm(800, 800);
- hatMaus = new Maus();
- hatStift = new Buntstift();
- hatUhr = new Uhr();
- zWinkel = -90;
- zVWinkel = -135;
- zRichtung = 1;
- hatStift.setzeFarbe(Farbe.GRUEN);
- hatStift.setzeFuellmuster(Muster.GEFUELLT);
- hatStift.bewegeBis(400, 0);
- this.bewegeDich();
- }
- // Dienste
- public void bewegeDich()
- {
- while(!hatMaus.doppelKlick())
- {
- this.loescheDich();
- hatStift.dreheUm(zRichtung);
- this.zeigeDich();
- hatUhr.warte(10);
- zWinkel = zWinkel + zRichtung * 2;
- if ((zVWinkel < zWinkel) || (zVWinkel > zWinkel))
- {
- zRichtung = -zRichtung;
- }
- }
- }
- public void zeichneDich()
- {
- hatStift.runter();
- hatStift.dreheUm(-90);
- hatStift.bewegeUm(350);
- hatStift.zeichneKreis(50);
- hatStift.dreheUm(90);
- hatStift.bewegeBis(400, 0);
- }
- public void loescheDich()
- {
- hatStift.radiere();
- this.zeichneDich();
- }
- public void zeigeDich()
- {
- hatStift.normal();
- this.zeichneDich();
- }
- }
ich hoffe ihr könnt mir helfen
![:D](https://www.easy-coding.de/wcf/images/smilies/biggrin.png)
danke schonma im vorraus
![:thumbsup:](https://www.easy-coding.de/wcf/images/smilies/thumbsup.png)
Flav
// edit by vince - highlighting