@@ -39,15 +39,18 @@ public class Game { | |||
} | |||
public void setVariables() { | |||
//Room Object | |||
// Intro Raum | |||
intro = new Room("Intro"); | |||
intro.setDescription("Hier ist das Intro von Kidnappd"); | |||
intro.puzzles.add(durchgang); | |||
durchgang.setNextRoom(keller); | |||
durchgang = new Puzzle("Durchgang"); | |||
durchgang.setSolvedText("Hurra, du hast das Intro Level beendet"); | |||
intro.puzzles.add(durchgang); | |||
//Raum Object | |||
keller = new Room("Keller"); | |||
durchgang.setNextRoom(keller); | |||
keller.setDescription("der kleine Mondschein, der zuvor den unbekannten Raum schwach beleuchtet hat, leuchtet viel gr��er und viel heller und du erkennst nun den gesamten Raum. Er ist klein und d�ster. " | |||
+ "überall h�ngen Spinnennetze und Staub sammelt sich am Betonboden. Du erkennst am anderen Ende des Raumes eine T�r"); | |||
@@ -1,55 +0,0 @@ | |||
public class Item | |||
{ | |||
private int id; | |||
private String name; | |||
private boolean portableFlag; | |||
private boolean hiddenFlag; | |||
private String description; | |||
public Item(String name) | |||
{ | |||
this.name = name; | |||
} | |||
public String getDescription() | |||
{ | |||
return description; | |||
} | |||
public void setDescription(String description) | |||
{ | |||
this.description = description; | |||
} | |||
public int getId() { | |||
return id; | |||
} | |||
public void setId(int id) { | |||
this.id = id; | |||
} | |||
public String getName() { | |||
return name; | |||
} | |||
public void setName(String name) { | |||
this.name = name; | |||
} | |||
public boolean isPortableFlag() { | |||
return portableFlag; | |||
} | |||
public void setPortableFlag(boolean portableFlag) { | |||
this.portableFlag = portableFlag; | |||
} | |||
public boolean isHiddenFlag() { | |||
return hiddenFlag; | |||
} | |||
public void setHiddenFlag(boolean hiddenFlag) { | |||
this.hiddenFlag = hiddenFlag; | |||
} | |||
} |
@@ -1,69 +0,0 @@ | |||
import java.util.ArrayList; | |||
public class Room | |||
{ | |||
private int id; | |||
private String name; | |||
private String description; | |||
private boolean gameoverFlag; | |||
ArrayList<Item> items = new ArrayList<>(); | |||
ArrayList<Puzzle> puzzles = new ArrayList<>(); | |||
public Room(String name) | |||
{ | |||
this.name = name; | |||
} | |||
public Item getItem(String s) | |||
{ | |||
for(Item i: items) | |||
{ | |||
if(i.getName().equals(s)) | |||
return i; | |||
} | |||
return null; | |||
} | |||
public Puzzle getPuzzle(String s) | |||
{ | |||
for(Puzzle p: puzzles) | |||
{ | |||
if(p.getName().equals(s)) | |||
return p; | |||
} | |||
return null; | |||
} | |||
public int getId() { | |||
return id; | |||
} | |||
public void setId(int id) { | |||
this.id = id; | |||
} | |||
public String getName() { | |||
return name; | |||
} | |||
public void setName(String name) { | |||
this.name = name; | |||
} | |||
public String getDescription() { | |||
return description; | |||
} | |||
public void setDescription(String description) { | |||
this.description = description; | |||
} | |||
public boolean getGameoverFlag() { | |||
return gameoverFlag; | |||
} | |||
public void setGameoverFlag(boolean gameOverFlag) { | |||
gameoverFlag = gameOverFlag; | |||
} | |||
public ArrayList<Item> getItems() { | |||
return items; | |||
} | |||
public ArrayList<Puzzle> getPuzzles() { | |||
return puzzles; | |||
} | |||
} |
@@ -25,6 +25,7 @@ | |||
<option>Tür</option> | |||
<option>Schloss</option> | |||
<option>Schlüssel</option> | |||
<option>Durchgang</option> | |||
</select> | |||
</div> | |||
<div id="output"> |