win and lose it allll
This commit is contained in:
parent
810ab1880b
commit
038b07511b
2 changed files with 17 additions and 9 deletions
|
@ -97,11 +97,11 @@ public class Die extends Actor {
|
||||||
if (selected != this.selected)
|
if (selected != this.selected)
|
||||||
{
|
{
|
||||||
if (selected) {
|
if (selected) {
|
||||||
transform.y += 64;
|
transform.y += 32;
|
||||||
transform.rotation = 20;
|
transform.rotation = 20;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
transform.y -= 64;
|
transform.y -= 32;
|
||||||
transform.rotation = 0;
|
transform.rotation = 0;
|
||||||
}
|
}
|
||||||
} // terrible
|
} // terrible
|
||||||
|
|
|
@ -14,8 +14,6 @@ import com.monjaro.gamejam.segment.*;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import static com.badlogic.gdx.graphics.GL20.*;
|
|
||||||
|
|
||||||
public class Game extends ApplicationAdapter {
|
public class Game extends ApplicationAdapter {
|
||||||
|
|
||||||
private final List<Die> dice = new ArrayList<>();
|
private final List<Die> dice = new ArrayList<>();
|
||||||
|
@ -92,9 +90,15 @@ public class Game extends ApplicationAdapter {
|
||||||
public void processInput() {
|
public void processInput() {
|
||||||
Input input = Gdx.input;
|
Input input = Gdx.input;
|
||||||
|
|
||||||
if (input.isKeyJustPressed(Input.Keys.R) && round.getRerolls() > 0) { //reroll dice that aren't locked
|
if (input.isKeyJustPressed(Input.Keys.R)) { //reroll dice that aren't locked
|
||||||
|
if (round.getRerolls() > 0) {
|
||||||
reroll();
|
reroll();
|
||||||
round.reduceRerolls(1);
|
round.reduceRerolls(1);
|
||||||
|
} else {
|
||||||
|
for (int i = 0; i < 6; i++) {
|
||||||
|
dice.forEach(Die::decay);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dieNet.setVisible(input.isKeyPressed(Input.Keys.CONTROL_LEFT));
|
dieNet.setVisible(input.isKeyPressed(Input.Keys.CONTROL_LEFT));
|
||||||
|
@ -172,6 +176,7 @@ public class Game extends ApplicationAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
int y = Gdx.graphics.getHeight() / 3 * 2 - 25;
|
int y = Gdx.graphics.getHeight() / 3 * 2 - 25;
|
||||||
|
font.draw(batch, "[#9E65A8] ROUND " + roundNumber, 100, y -= 20);
|
||||||
for (Decay decay : round.getDecays()) {
|
for (Decay decay : round.getDecays()) {
|
||||||
font.draw(batch, "[#9E65A8]" + decay.getDescription(), 100, y -= 20);
|
font.draw(batch, "[#9E65A8]" + decay.getDescription(), 100, y -= 20);
|
||||||
}
|
}
|
||||||
|
@ -194,10 +199,13 @@ public class Game extends ApplicationAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void nextRound() {
|
public void nextRound() {
|
||||||
|
if (roundNumber < 10) {
|
||||||
|
|
||||||
round = generateRound(++roundNumber);
|
round = generateRound(++roundNumber);
|
||||||
|
|
||||||
generateShope();
|
generateShope();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Round generateRound(int difficulty) {
|
public Round generateRound(int difficulty) {
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
|
|
Loading…
Add table
Reference in a new issue