(Die Seite wurde neu angelegt: „{{DISPLAYTITLE:EA 4.x Tutorial: Hello World}} {{4.xTutorialHeader}} == Inhalt == In diesem Tutorial: * Erstellst du deine erste Scene * Baust du die einfac…“)
 
Zeile 8: Zeile 8:
  
 
* Erstellst du deine erste Scene
 
* Erstellst du deine erste Scene
* Baust du die einfachsten graphischen Objekte in dein Spiel ein
+
* Baust du einfache geometrische Objekte in dein Spiel ein
 +
 
 +
== Hello World ==
 +
 
 +
<source lang="java">
 +
public class HelloWorld_v1
 +
        extends Scene{
 +
 
 +
    public HelloWorld_v1() {
 +
        Text helloworld = new Text("Hello World", 2);
 +
        helloworld.setCenter(0,1);
 +
        this.add(helloworld);
 +
    }
 +
 
 +
    /*  17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)~ STARTING THE GAME 17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)~  */
 +
 
 +
    public static void main(String[] args) {
 +
        startGame();
 +
    }
 +
 
 +
    public static void startGame() {
 +
        Scene helloWorld = new HelloWorld();
 +
        Game.start(400, 300, helloWorld);
 +
    }
 +
}
 +
</code>

Version vom 4. Januar 2020, 18:08 Uhr


Dies ist ein Tutorial für die Engine Alpha 4.x. Diese funktioniert anders als die EDU-Version. Du findest eine Übersicht über alle Tutorials hier.

Inhalt

In diesem Tutorial:

  • Erstellst du deine erste Scene
  • Baust du einfache geometrische Objekte in dein Spiel ein

Hello World

<source lang="java"> public class HelloWorld_v1

       extends Scene{
   public HelloWorld_v1() {
       Text helloworld = new Text("Hello World", 2);
       helloworld.setCenter(0,1);
       this.add(helloworld);
   }
   /*  17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)~ STARTING THE GAME 17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)17:07, 4. Jan. 2020 (CET)~  */
   public static void main(String[] args) {
       startGame();
   }
   public static void startGame() {
       Scene helloWorld = new HelloWorld();
       Game.start(400, 300, helloWorld);
   }

}