MCPcopy Create free account
hub / github.com/melonjs/melonJS / buildMapJSON

Function buildMapJSON

packages/melonjs/tests/tmxlayer-data.spec.js:38–62  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

36
37// 4 cols x 3 rows = 12 cells, with a mix of empty (0) and populated cells
38function buildMapJSON(data) {
39 return {
40 width: 4,
41 height: 3,
42 tilewidth: 32,
43 tileheight: 32,
44 orientation: "orthogonal",
45 renderorder: "right-down",
46 infinite: false,
47 version: "1.10",
48 tiledversion: "1.12.0",
49 tilesets: [tilesetData],
50 layers: [
51 {
52 type: "tilelayer",
53 name: "Background",
54 width: 4,
55 height: 3,
56 data,
57 visible: true,
58 opacity: 1,
59 },
60 ],
61 };
62}
63
64function makeLayer(data) {
65 const map = new TMXTileMap("test", buildMapJSON(data));

Callers 1

makeLayerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected