adjusted SpaceSnake spawn position and random bounds

This commit is contained in:
2025-10-15 00:51:08 +02:00
parent db78ff33ce
commit a8a15a1c7c

View File

@@ -39,8 +39,8 @@ public class SpaceSnake extends StatelessGame {
private final Map<Player, PlayState> playerBlocks = new WeakHashMap<>();
private int mapSize;
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> posInBoundsW = () -> this.rnd.nextInt(-this.mapSize/2, this.mapSize/2);
private final Supplier<Integer> posInBoundsH = () -> this.rnd.nextInt(-60, 300);
public SpaceSnake(int mapSize, int powerUpCount) {
super(Dimension.THE_END.key, "spaceSnake", new PointsWinScore());
@@ -81,7 +81,7 @@ public class SpaceSnake extends StatelessGame {
@Override
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(
new AtomicInteger(3),
new ArrayDeque<>(List.of(spawn)),