summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index f077dd6..56ce4bd 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -1,6 +1,7 @@
package ch.asynk.tankontank.game;
import java.util.Iterator;
+import java.util.Random;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.assets.AssetManager;
@@ -25,6 +26,8 @@ public abstract class Map extends Board
{
private final Ctrl ctrl;
+ private Random rand = new Random();
+
public final Board.TileCollection possibleMoves;
public final PossiblePaths possiblePaths;
@@ -43,6 +46,11 @@ public abstract class Map extends Board
protected abstract void setup();
+ public int d6()
+ {
+ return rand.nextInt(6) + 1;
+ }
+
public Map(final TankOnTank game, Board.Config cfg, String textureName)
{
super(game.factory, cfg, game.manager.get(textureName, Texture.class));