zuul 7
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package de.szut.zuul;
|
||||
|
||||
import java.sql.SQLOutput;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
@@ -68,7 +67,7 @@ public class Game
|
||||
// add muffins to random rooms
|
||||
Room[] rooms = {marketsquare, templePyramid, tavern, sacrificialSite, hut, jungle, secretPassage, cave, beach, basement, wizardsRoom};
|
||||
Random random = new Random();
|
||||
for (int i = 0; i < 3; i++) { // Add 3 muffins to random rooms
|
||||
for (int i = 0; i < 3; i++) {
|
||||
int randomIndex = random.nextInt(rooms.length);
|
||||
rooms[randomIndex].putItem(new Item("Muffin", "a delicious muffin", 0.2));
|
||||
}
|
||||
@@ -114,6 +113,8 @@ public class Game
|
||||
|
||||
/**
|
||||
* Main play routine. Loops until end of play.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public void play()
|
||||
{
|
||||
|
||||
@@ -43,9 +43,8 @@ public class Player {
|
||||
public double getLoadCapacity() {
|
||||
return loadCapacity;
|
||||
}
|
||||
public double eatMuffin() {
|
||||
public void eatMuffin() {
|
||||
loadCapacity += new Random().nextInt(11);
|
||||
return loadCapacity;
|
||||
}
|
||||
|
||||
private double calculateWeight() {
|
||||
|
||||
Reference in New Issue
Block a user