Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
- import java.util.*;
- import org.jdom2.Document;
- import org.jdom2.input.SAXBuilder;
- /**
- * Write a description of class strand here.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class strand extends World
- {
- Document xml;
- /**
- * Constructor for objects of class strand.
- *
- */
- public strand()
- {
- // Create a new world with 600x400 cells with a cell size of 1x1 pixels.
- super(1020,600, 1);
- prepare();
- }
- private void createXML()
- {
- try
- {
- Document theXMLDoc = new SAXBuilder().build("xmldata/Chilledkroete.xml");
- this.xml = theXMLDoc;
- }
- catch (Exception e)
- {
- }
- }
- /**
- * Bereite die Welt für den Programmstart vor. Das heißt: Erzeuge die Anfangs-
- * Objekte und füge sie der Welt hinzu.
- */
- private void prepare()
- {
- chilldkroete chilldkroete = new chilldkroete();
- addObject(chilldkroete, 100, 570);
- chilldkroete.setLocation(90, 569);
- chilldkroete.setLocation(91, 569);
- theRock therock = new theRock();
- addObject(therock, 178, 462);
- theRock therock2 = new theRock();
- addObject(therock2, 894, 466);
- theRock therock3 = new theRock();
- addObject(therock3, 183, 131);
- theRock therock4 = new theRock();
- addObject(therock4, 906, 130);
- theRock therock5 = new theRock();
- addObject(therock5, 316, 222);
- theRock therock6 = new theRock();
- addObject(therock6, 906, 288);
- theRock therock7 = new theRock();
- addObject(therock7, 277, 368);
- theRock therock8 = new theRock();
- addObject(therock8, 598, 130);
- theRock therock9 = new theRock();
- addObject(therock9, 484, 372);
- theRock therock10 = new theRock();
- addObject(therock10, 719, 465);
- theRock therock11 = new theRock();
- addObject(therock11, 705, 252);
- theRock therock12 = new theRock();
- addObject(therock12, 449, 189);
- theRock therock13 = new theRock();
- addObject(therock13, 26, 284);
- LobsterFeind lobsterfeind = new LobsterFeind();
- addObject(lobsterfeind, 389, 29);
- lobsterfeind.setRotation(90);
- LobsterFeind lobsterfeind2 = new LobsterFeind();
- addObject(lobsterfeind2, 818, 578);
- lobsterfeind2.setLocation(813, 573);
- lobsterfeind2.setRotation(-90);
- Energydrink energydrink = new Energydrink();
- addObject(energydrink, 898, 385);
- energydrink.setLocation(896, 393);
- Energydrink energydrink2 = new Energydrink();
- addObject(energydrink2, 28, 213);
- Energydrink energydrink3 = new Energydrink();
- addObject(energydrink3, 292, 295);
- Energydrink energydrink4 = new Energydrink();
- addObject(energydrink4, 696, 183);
- lobsterfeind.setLocation(391, 133);
- therock12.setLocation(389, 49);
- therock5.setLocation(434, 506);
- therock5.setLocation(434, 506);
- therock5.setLocation(434, 506);
- therock5.setLocation(434, 506);
- therock5.setLocation(434, 506);
- therock5.setLocation(434, 506);
- therock5.setLocation(392, 598);
- lobsterfeind2.setLocation(807, 491);
- therock10.setLocation(719, 465);
- therock10.setLocation(719, 465);
- therock10.setLocation(719, 465);
- therock10.setLocation(801, 577);
- therock10.setLocation(807, 589);
- lobsterfeind2.setLocation(809, 511);
- therock6.setLocation(776, 90);
- therock6.setLocation(810, 42);
- therock12.setLocation(281, 217);
- lobsterfeind.setLocation(387, 91);
- therock5.setLocation(406, 520);
- lobsterfeind2.setLocation(813, 449);
- therock10.setLocation(681, 469);
- lobsterfeind2.setLocation(815, 537);
- therock6.setLocation(906, 322);
- therock6.setLocation(908, 320);
- therock5.setLocation(468, 246);
- therock9.setLocation(454, 504);
- therock9.setLocation(462, 510);
- therock5.setLocation(512, 316);
- Pelikan pelikan = new Pelikan();
- addObject(pelikan, 698, 328);
- pelikan.setLocation(672, 394);
- Pelikan pelikan2 = new Pelikan();
- addObject(pelikan2, 803, 228);
- }
- private void prepare2()
- {
- chilldkroete chilldkroete = new chilldkroete();
- addObject(chilldkroete, Greenfoot.getRandomNumber(1020),Greenfoot.getRandomNumber(600));
- }
- private void prepare3()
- {
- chilldkroete chilldkroete = new chilldkroete();
- addObject(chilldkroete, 40,40);
- theRock theRock = new theRock();
- addObject(theRock,50,50);
- LobsterFeind LobsterFeind = new LobsterFeind();
- addObject(LobsterFeind,60,60);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement