Zum Inhalt springen

Ira

Mitglieder
  • Gesamte Inhalte

    1
  • Benutzer seit

  • Letzter Besuch

Alle Inhalte von Ira

  1. Ira

    BlueJ Buntstift

    Hallo ich habe jezt ein paar Wochen Informatik in der Schule und wollte wir programmieren gerade eine Dartscheibe etc. Nun würde ich den Pfiel gerne bunt machen. Könnt ihr mir helfen? Hier erstmal das, was ich bislang alles programmiert habe: import sum.kern.*; /** * @author * @version */ public class Dart { // Bezugsobjekte Bildschirm hatBildschirm; Stift hatStift; Maus hatMaus; // Attribute // Konstruktor public Dart() { hatBildschirm = new Bildschirm (800,600); hatStift = new Stift(); hatMaus = new Maus(); } // Dienste public void fuehreAus() { // zeichne Scheibe hatStift.bewegeBis(600,100); hatStift.zeichneKreis(10); hatStift.zeichneKreis(20); hatStift.zeichneKreis(30); hatStift.zeichneKreis(40); hatStift.zeichneKreis(50); // bewege zu Pfeil hatStift.bewegeBis(100,100); //drehe zu Dartscheibe Mitte hatStift.dreheBis(38.6598); // zeichne Pfeil hatStift.runter(); hatStift.bewegeUm(100); hatStift.hoch(); hatStift.bewegeUm(5); hatStift.runter(); hatStift.zeichneKreis(5); do { this.radierePfeil(); hatStift.dreheBis(270); hatStift.bewegeUm(0.05); hatStift.dreheBis(38.6598); this.zeichnePfeil(); } while(!hatMaus.istGedrueckt()); do { this.radierePfeil(); hatStift.bewegeUm(0.1); this.zeichnePfeil(); } while (hatStift.hPosition() < 600); hatStift.hoch(); hatStift.bewegeBis(600,100); hatStift.zeichneKreis(10); hatStift.zeichneKreis(20); hatStift.zeichneKreis(30); hatStift.zeichneKreis(40); hatStift.zeichneKreis(50); } private void radierePfeil() { hatStift.radiere(); hatStift.zeichneKreis(5); hatStift.hoch(); hatStift.bewegeUm(-5); hatStift.runter(); hatStift.bewegeUm(-100); } private void zeichnePfeil() { hatStift.normal(); hatStift.bewegeUm(100); hatStift.hoch(); hatStift.bewegeUm(5); hatStift.runter(); hatStift.zeichneKreis(5); } } hoffe, dass ihr mit helfen könnt Ira

Fachinformatiker.de, 2024 by SE Internet Services

fidelogo_small.png

Schicke uns eine Nachricht!

Fachinformatiker.de ist die größte IT-Community
rund um Ausbildung, Job, Weiterbildung für IT-Fachkräfte.

Fachinformatiker.de App

Download on the App Store
Get it on Google Play

Kontakt

Hier werben?
Oder sende eine E-Mail an

Social media u. feeds

Jobboard für Fachinformatiker und IT-Fachkräfte

×
×
  • Neu erstellen...