3 DevMaps
Andus edited this page 2024-06-02 20:27:55 +02:00

Maps

This page covers everything related to development of game maps.

Important info while building maps:

See Forbidden Blocks

Moving Walls:

How it works:

The walls are pushed using PistonPusher (see Custom Classes). Players that were pushed off are eliminated until the end of the game.

Map generator:

A map is generated every time in a size of 16x3x16

Walls generation:

Walls need to be created using code

Example:

private static void wall4(Instance instance) {
    ArrayList<Pos> positions = new ArrayList<>();
    for (int x = 15; x >= 0; x--) {
        for (int y = 4; y <= 7; y++) {
            if (x == 7 && y == 4) { // Gap at x7, y4
                continue; // Skip this position to create the gap
            }
            int z = 18;
            positions.add(new Pos(x, y, z));
        }
    }

    for (Pos pos : positions) {
        instance.setBlock(pos, Block.SLIME_BLOCK);
    }
    for (Pos pos : positions) {
        PistonPusher.push(instance, pos, Direction.NORTH, 20);
    }
}