summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-17 10:56:47 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-17 10:56:47 +0100
commit18d2acf816d33b7ee3174c43f49d78fc263ce208 (patch)
tree8fd86dd8a6924a626507eccb52cc2d73c32f9037 /core
parent2af45b7ef93cebe03c1e24bb12e04f0facb8d336 (diff)
downloadRustAndDust-18d2acf816d33b7ee3174c43f49d78fc263ce208.zip
RustAndDust-18d2acf816d33b7ee3174c43f49d78fc263ce208.tar.gz
Map: add int d6()
Diffstat (limited to 'core')
-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));