waitForKey();
clearScreen();
World.fromFile( "res/tileset.lw" );
TileSet tileSet = World.editorData.tilesets.getFirst();
TileMap tileMap = TileMap.create( tileSet, mapSize, mapSize );
tileMap.setSize( 400d / 25d, 400d / 25d );
Project.printText( "Step 3: loading world, extract tileset from there and" );
Project.printText( "creating tilemap with same size and this tileset", 1 );
drawDoubleMap( doubleMap );
swapBuffers();
waitForKey();
clearScreen();
doubleMap.extractTo( tileMap, 0.5d, 1d, filledTileNum );
Project.printText( "Step 4: setting tiles number of tilemap to FilledTileNum" );
Project.printText( "if corresponding value of Double map is higher than 0.5", 1 );
tileMap.draw();
drawSignature();
swapBuffers();
waitForKey();
clearScreen();
for( int y = 0; y < mapSize; y++ ) {
for( int x = 0; x < mapSize; x++ ) {
fix( tileMap, x, y );
}
}
printText( "Step 5: preparing tilemap by fixing some unmanaged cell positions" );
tileMap.draw();
drawSignature();
swapBuffers();
waitForKey();
clearScreen();
tileMap.enframe();
printText( "Step 6a: enframing tile map" );
tileMap.draw();
drawSignature();
swapBuffers();
waitForKey();
clearScreen();
TileSet.prolongTiles = false;
tileMap.enframe() ;
printText( "Step 6b: enframing tile map with prolonging tiles off" );
tileMap.draw();
drawSignature();
swapBuffers();
waitForKey();