diff --git a/core/src/com/monjaro/gamejam/Die.java b/core/src/com/monjaro/gamejam/Die.java index b73e40a..18ebcea 100644 --- a/core/src/com/monjaro/gamejam/Die.java +++ b/core/src/com/monjaro/gamejam/Die.java @@ -52,9 +52,7 @@ public class Die extends Actor { } public void roll() { - if (!locked) { - faceIndex = random.nextInt(6); - } + faceIndex = random.nextInt(6); } public void decay() { //remove a pip from all faces of this die diff --git a/core/src/com/monjaro/gamejam/Game.java b/core/src/com/monjaro/gamejam/Game.java index f457a32..9be2d61 100644 --- a/core/src/com/monjaro/gamejam/Game.java +++ b/core/src/com/monjaro/gamejam/Game.java @@ -46,8 +46,8 @@ public class Game extends ApplicationAdapter { public void processInput() { Input input = Gdx.input; - if (input.isKeyJustPressed(Input.Keys.R)) { //reroll dice - dice.forEach(Die::roll); + if (input.isKeyJustPressed(Input.Keys.R)) { //reroll dice that aren't locked + dice.stream().filter(d -> !d.isLocked()).forEach(Die::roll); } for (int i = 0; i < dice.size(); i++) { //lock dice, iterating over for each keycode