adjusted SpaceSnake spawn position and random bounds
This commit is contained in:
@@ -40,7 +40,7 @@ public class SpaceSnake extends StatelessGame {
|
|||||||
private final Map<Player, PlayState> playerBlocks = new WeakHashMap<>();
|
private final Map<Player, PlayState> playerBlocks = new WeakHashMap<>();
|
||||||
private int mapSize;
|
private int mapSize;
|
||||||
private final Supplier<Integer> posInBoundsW = () -> this.rnd.nextInt(-this.mapSize/2, this.mapSize/2);
|
private final Supplier<Integer> posInBoundsW = () -> this.rnd.nextInt(-this.mapSize/2, this.mapSize/2);
|
||||||
private final Supplier<Integer> posInBoundsH = () -> this.rnd.nextInt(-32, 100);
|
private final Supplier<Integer> posInBoundsH = () -> this.rnd.nextInt(-60, 300);
|
||||||
|
|
||||||
public SpaceSnake(int mapSize, int powerUpCount) {
|
public SpaceSnake(int mapSize, int powerUpCount) {
|
||||||
super(Dimension.THE_END.key, "spaceSnake", new PointsWinScore());
|
super(Dimension.THE_END.key, "spaceSnake", new PointsWinScore());
|
||||||
@@ -81,7 +81,7 @@ public class SpaceSnake extends StatelessGame {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean onPlayerJoin(Player p) {
|
protected boolean onPlayerJoin(Player p) {
|
||||||
Pos spawn = new Pos(this.posInBoundsW.get(), 50, this.posInBoundsW.get());
|
Pos spawn = new Pos(this.posInBoundsW.get(), -60, this.posInBoundsW.get());
|
||||||
PlayState state = new PlayState(
|
PlayState state = new PlayState(
|
||||||
new AtomicInteger(3),
|
new AtomicInteger(3),
|
||||||
new ArrayDeque<>(List.of(spawn)),
|
new ArrayDeque<>(List.of(spawn)),
|
||||||
|
Reference in New Issue
Block a user