Skip to content

Commit 8f2897c

Browse files
committedFeb 1, 2024
Updates examples
Removes references to tileSize, not needed
1 parent f5e0a43 commit 8f2897c

9 files changed

+26
-30
lines changed
 

‎examples/basic-2d-map.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import labyrinthos from '../lib/labyrinthos.js';
22

33
let map = new labyrinthos.TileMap({
44
width: 32,
5-
height: 32,
6-
tileWidth: 16,
7-
tileHeight: 16
5+
height: 32
86
});
97

108
map.fill(1); // fill entire map with 1

‎examples/biome-forest.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import labyrinthos from '../lib/labyrinthos.js';
33
// Create a new tile map
44
let map = new labyrinthos.TileMap({
55
width: 32,
6-
height: 32,
7-
tileWidth: 16,
8-
tileHeight: 16
6+
height: 32
97
});
108

119
//

‎examples/export-Tiled-tmj.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import labyrinthos from '../lib/labyrinthos.js';
22
import fs from 'fs';
33
let map = new labyrinthos.TileMap({
44
width: 16,
5-
height: 16,
6-
tileWidth: 16,
7-
tileHeight: 16
5+
height: 16
86
});
97

108
map.fill(1); // reset map to 1

‎examples/large-2d-map.js

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
import labyrinthos from '../lib/labyrinthos.js';
2+
import generateMap from '../lib/mazes/RecursiveBacktrack.js';
23

34
let map = new labyrinthos.TileMap({
45
width: 100,
5-
height: 100,
6-
tileWidth: 16,
7-
tileHeight: 16
6+
height: 100
87
});
98

9+
map.seed(123);
1010

11+
map.fill(1);
12+
console.log('map', map)
13+
console.log('random', map.random())
14+
generateMap(map, {});
1115

12-
console.log('map', map)
16+
labyrinthos.terrains.FaultLine(map, {});
17+
18+
// normalize to tile set index
19+
map.scaleToTileRange(4);
20+
21+
console.log('map', map);
22+
console.log('map', map.mask());

‎examples/lsystem-map.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import labyrinthos from '../lib/labyrinthos.js';
33
// Create a new tile map
44
let map = new labyrinthos.TileMap({
55
width: 32,
6-
height: 32,
7-
tileWidth: 16,
8-
tileHeight: 16
6+
height: 32
97
});
108

119
map.seed(1234);

‎examples/lsystem-parametric-map.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import labyrinthos from '../lib/labyrinthos.js';
33
// Create a new tile map
44
let map = new labyrinthos.TileMap({
55
width: 32,
6-
height: 32,
7-
tileWidth: 16,
8-
tileHeight: 16
6+
height: 32
97
});
108

119
map.seed(1234);

‎examples/roguelike-mask.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import generateMap from '../lib/mazes/RecursiveBacktrack.js';
33

44
let map = new labyrinthos.TileMap({
55
width: 64,
6-
height: 32,
7-
tileWidth: 16,
8-
tileHeight: 16
6+
height: 32
97
});
108

119
console.log('map', map)

‎examples/sub-maps.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import labyrinthos from '../lib/labyrinthos.js';
22

33
// Main map
4-
const mainMap = new labyrinthos.TileMap({ width: 8, height: 8, tileWidth: 16, tileHeight: 16 });
4+
const mainMap = new labyrinthos.TileMap({ width: 8, height: 8 });
55

66
// Submaps
7-
const subMap1 = new labyrinthos.TileMap({ width: 4, height: 4, tileWidth: 16, tileHeight: 16 });
8-
const subMap2 = new labyrinthos.TileMap({ width: 4, height: 4, tileWidth: 16, tileHeight: 16 });
9-
const subMap3 = new labyrinthos.TileMap({ width: 4, height: 4, tileWidth: 16, tileHeight: 16 });
10-
const subMap4 = new labyrinthos.TileMap({ width: 4, height: 4, tileWidth: 16, tileHeight: 16 });
7+
const subMap1 = new labyrinthos.TileMap({ width: 4, height: 4 });
8+
const subMap2 = new labyrinthos.TileMap({ width: 4, height: 4 });
9+
const subMap3 = new labyrinthos.TileMap({ width: 4, height: 4 });
10+
const subMap4 = new labyrinthos.TileMap({ width: 4, height: 4 });
1111

1212
// Fill each submap with distinct values
1313
subMap1.fill(1);

‎examples/tilemap-query.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import labyrinthos from '../lib/labyrinthos.js';
22

33
let map = new labyrinthos.TileMap({
44
width: 8,
5-
height: 8,
6-
tileWidth: 16,
7-
tileHeight: 16
5+
height: 8
86
});
97

108
map.fill(1); // fill entire map with 1

0 commit comments

Comments
 (0)
Please sign in to comment.