squishjs 0.7.4 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +674 -21
- package/package.json +1 -1
- package/src/GameNode.js +1 -1
- package/src/InternalGameNode.js +1 -1
- package/src/Squisher.js +37 -28
- package/src/util/views.js +15 -12
- package/test/main.test.js +7 -6
- package/test/utils.js +1 -1
- package/oldsvgexport.js +0 -89
- package/render-tester.js +0 -120
- package/test/StateUpdates.js +0 -10
- package/testapp.html +0 -26
- package/testapp.js +0 -988
package/package.json
CHANGED
package/src/GameNode.js
CHANGED
package/src/InternalGameNode.js
CHANGED
|
@@ -2,7 +2,7 @@ let _id = 0;
|
|
|
2
2
|
|
|
3
3
|
class InternalGameNode {
|
|
4
4
|
constructor(color, onClick, coordinates2d, border, fill, text, asset, playerIds = [], effects = null, input = null, subType = null, id = null) {
|
|
5
|
-
this.id = id ? Number(id) : _id
|
|
5
|
+
this.id = id ? Number(id) : Number(_id++);
|
|
6
6
|
this.children = new Array();
|
|
7
7
|
this.color = color;
|
|
8
8
|
this.handleClick = onClick;
|
package/src/Squisher.js
CHANGED
|
@@ -6,21 +6,24 @@ const INVISIBLE_PLAYER_ID = 0;
|
|
|
6
6
|
const DEFAULT_TICK_RATE = 60;
|
|
7
7
|
|
|
8
8
|
class Squisher {
|
|
9
|
-
constructor({ game, scale, customBottomLayer, customTopLayer }) {
|
|
9
|
+
constructor({ game, scale, customBottomLayer, customTopLayer, onAssetUpdate }) {
|
|
10
10
|
this.ids = new Set();
|
|
11
11
|
|
|
12
12
|
this.game = game;
|
|
13
|
+
this.assets = {};
|
|
13
14
|
|
|
14
15
|
this.customBottomLayer = customBottomLayer;
|
|
15
16
|
this.customTopLayer = customTopLayer;
|
|
16
17
|
|
|
18
|
+
this.initialize();
|
|
19
|
+
this.onAssetUpdate = onAssetUpdate;
|
|
20
|
+
|
|
17
21
|
this.playerFrames = {};
|
|
18
22
|
|
|
19
23
|
this.listeners = new Set();
|
|
20
24
|
this.scale = scale || {x: 1, y: 1};
|
|
21
25
|
this.state = this.squish(this.game.getLayers());
|
|
22
|
-
|
|
23
|
-
this.assets = {};
|
|
26
|
+
|
|
24
27
|
if (this.game.tick) {
|
|
25
28
|
const tickRate = this.gameMetadata && this.gameMetadata.tickRate ? this.gameMetadata.tickRate : DEFAULT_TICK_RATE;
|
|
26
29
|
setInterval(this.game.tick.bind(this.game), 1000 / tickRate);
|
|
@@ -91,6 +94,12 @@ class Squisher {
|
|
|
91
94
|
return this.playerFrames[playerId];
|
|
92
95
|
}
|
|
93
96
|
|
|
97
|
+
handleNewAsset(key, asset) {
|
|
98
|
+
return new Promise((resolve, reject) => {
|
|
99
|
+
this.initialize().then(resolve);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
94
103
|
squishHelper(node, squishedNodes, scale = {x: 1, y: 1}, playerMap = {}, playerIdFilter = new Set()) {
|
|
95
104
|
if (!node.node.listeners.has(this)) {
|
|
96
105
|
node.addListener(this);
|
|
@@ -143,29 +152,34 @@ class Squisher {
|
|
|
143
152
|
|
|
144
153
|
initialize() {
|
|
145
154
|
return new Promise((resolve, reject) => {
|
|
146
|
-
|
|
155
|
+
|
|
147
156
|
|
|
148
|
-
|
|
157
|
+
const assets = Object.assign({}, this.assets || {});
|
|
149
158
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
159
|
+
const gameMetadata = this.game.constructor.metadata && this.game.constructor.metadata();
|
|
160
|
+
|
|
161
|
+
const gameAssets = gameMetadata && gameMetadata.assets ? gameMetadata.assets : {};
|
|
162
|
+
|
|
163
|
+
if (this.customBottomLayer && this.customBottomLayer.assets) {
|
|
164
|
+
Object.assign(gameAssets, this.customBottomLayer.assets);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (this.customTopLayer && this.customTopLayer.assets) {
|
|
168
|
+
Object.assign(gameAssets, this.customTopLayer.assets);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (this.game.getAssets && this.game.getAssets()) {
|
|
172
|
+
Object.assign(gameAssets, this.game.getAssets());
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const allAssets = Object.assign(assets, gameAssets);
|
|
157
176
|
|
|
158
|
-
if (this.game.getAssets && this.game.getAssets()) {
|
|
159
|
-
Object.assign(gameAssets, this.game.getAssets());
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
const initializeAssetBundle = () => new Promise((resolve, reject) => {
|
|
163
177
|
let assetBundleSize = 0;
|
|
164
178
|
let finishedCount = 0;
|
|
165
|
-
const totalCount = Object.keys(
|
|
179
|
+
const totalCount = Object.keys(allAssets).length;
|
|
166
180
|
|
|
167
|
-
for (const key in
|
|
168
|
-
|
|
181
|
+
for (const key in allAssets) {
|
|
182
|
+
allAssets[key].getData().then(buf => {
|
|
169
183
|
const assetKeyLength = 32;
|
|
170
184
|
let keyIndex = 0;
|
|
171
185
|
const assetKeyArray = new Array(32);
|
|
@@ -176,7 +190,7 @@ class Squisher {
|
|
|
176
190
|
|
|
177
191
|
const encodedLength = (buf.length + assetKeyLength).toString(36);
|
|
178
192
|
|
|
179
|
-
const assetType =
|
|
193
|
+
const assetType = allAssets[key].info.type === 'image' ? 1 : 2;
|
|
180
194
|
|
|
181
195
|
const encodedMaxLength = 10;
|
|
182
196
|
let encodedLengthString = '';
|
|
@@ -204,16 +218,11 @@ class Squisher {
|
|
|
204
218
|
}
|
|
205
219
|
}
|
|
206
220
|
}
|
|
207
|
-
|
|
221
|
+
this.assetBundle = newAssetBundle;
|
|
222
|
+
resolve(newAssetBundle);
|
|
208
223
|
}
|
|
209
224
|
});
|
|
210
225
|
}
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
initializeAssetBundle().then((newAssetBundle) => {
|
|
214
|
-
this.assetBundle = newAssetBundle;
|
|
215
|
-
resolve();
|
|
216
|
-
});
|
|
217
226
|
|
|
218
227
|
});
|
|
219
228
|
}
|
package/src/util/views.js
CHANGED
|
@@ -4,7 +4,7 @@ const ShapeUtils = require('./shapes');
|
|
|
4
4
|
const GeometryUtils = require('./geometry');
|
|
5
5
|
const Colors = require('../Colors');
|
|
6
6
|
|
|
7
|
-
const getView = (plane, view, playerIds, translation = {}) => {
|
|
7
|
+
const getView = (plane, view, playerIds, translation = {}, scale = {}) => {
|
|
8
8
|
|
|
9
9
|
const wouldBeCollisions = GeometryUtils.checkCollisions(plane, {node: {coordinates2d: ShapeUtils.rectangle(view.x, view.y, view.w, view.h)}}, (node) => {
|
|
10
10
|
return node.node.id !== plane.node.id;
|
|
@@ -35,11 +35,15 @@ const getView = (plane, view, playerIds, translation = {}) => {
|
|
|
35
35
|
|
|
36
36
|
for (let coorPairIndex in vertices) {
|
|
37
37
|
const coordPair = vertices[coorPairIndex];
|
|
38
|
+
|
|
38
39
|
const x = coordPair[0];
|
|
39
40
|
const y = coordPair[1];
|
|
40
41
|
let translatedX = Math.max(Math.min(x - view.x, 100), 0);
|
|
41
42
|
let translatedY = Math.max(Math.min(y - view.y, 100), 0);
|
|
42
43
|
|
|
44
|
+
translatedX = (scale.x || 1) * translatedX;
|
|
45
|
+
translatedY = (scale.y || 1) * translatedY;
|
|
46
|
+
|
|
43
47
|
const shouldTranslate = translation.filter ? translation.filter(node) : true;
|
|
44
48
|
|
|
45
49
|
if (shouldTranslate) {
|
|
@@ -51,20 +55,19 @@ const getView = (plane, view, playerIds, translation = {}) => {
|
|
|
51
55
|
translatedY += translation.y;
|
|
52
56
|
}
|
|
53
57
|
|
|
54
|
-
if (translatedX < 0 || translatedX > 100) {
|
|
55
|
-
shouldInclude = false;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (translatedY < 0 || translatedY > 100) {
|
|
59
|
-
shouldInclude = false;
|
|
60
|
-
}
|
|
61
58
|
}
|
|
62
59
|
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
if (translatedX < 0) {
|
|
61
|
+
translatedX = 0;
|
|
62
|
+
} else if (translatedX > 100) {
|
|
63
|
+
translatedX = 100;
|
|
64
|
+
}
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
if (translatedY < 0) {
|
|
67
|
+
translatedY = 0;
|
|
68
|
+
} else if (translatedY > 100) {
|
|
69
|
+
translatedY = 100;
|
|
70
|
+
}
|
|
68
71
|
|
|
69
72
|
translatedCoords.push([translatedX, translatedY]);
|
|
70
73
|
}
|
package/test/main.test.js
CHANGED
|
@@ -48,6 +48,8 @@ const compareSquished = (preSquish, unsquished) => {
|
|
|
48
48
|
assert(preSquish[key][k] === unsquished[key][k]);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
+
} else if (key === 'id') {
|
|
52
|
+
assert(Number(preSquish[key]) === Number(unsquished[key]));
|
|
51
53
|
} else {
|
|
52
54
|
assert(preSquish[key] === unsquished[key]);
|
|
53
55
|
}
|
|
@@ -120,14 +122,13 @@ test("Text node with unicode", () => {
|
|
|
120
122
|
color: COLORS.BLACK
|
|
121
123
|
}
|
|
122
124
|
});
|
|
123
|
-
|
|
124
|
-
const squishedNode = new Uint8ClampedArray(squish(gameNode.node));
|
|
125
|
+
const squishedNode = new Uint8ClampedArray(squish(gameNode));
|
|
125
126
|
const unsquishedNode = unsquish(squishedNode);
|
|
126
127
|
compareSquished(squishedNode.node, unsquishedNode);
|
|
127
|
-
assert(unsquishedNode.text.text.length === 6);
|
|
128
|
-
assert([...unsquishedNode.text.text].length === 3);
|
|
129
|
-
assert(unsquishedNode.text.text.codePointAt(0) === '💯'.codePointAt(0));
|
|
130
|
-
assert(unsquishedNode.text.text.codePointAt(4) === '💯'.codePointAt(0));
|
|
128
|
+
assert(unsquishedNode.node.text.text.length === 6);
|
|
129
|
+
assert([...unsquishedNode.node.text.text].length === 3);
|
|
130
|
+
assert(unsquishedNode.node.text.text.codePointAt(0) === '💯'.codePointAt(0));
|
|
131
|
+
assert(unsquishedNode.node.text.text.codePointAt(4) === '💯'.codePointAt(0));
|
|
131
132
|
});
|
|
132
133
|
|
|
133
134
|
|
package/test/utils.js
CHANGED
package/oldsvgexport.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const { unsquish } = require('../src/squish');
|
|
3
|
-
const subtypes = require('../src/subtypes');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const svgText = (gameNode, container) => {
|
|
7
|
-
const fill = gameNode.node.text.color;
|
|
8
|
-
const align = gameNode.node.text.align;
|
|
9
|
-
|
|
10
|
-
let svgAlign;
|
|
11
|
-
if (align === 'left') {
|
|
12
|
-
svgAlign = 'end';
|
|
13
|
-
}
|
|
14
|
-
if (align === 'center') {
|
|
15
|
-
svgAlign = 'middle';
|
|
16
|
-
}
|
|
17
|
-
if (align === 'right') {
|
|
18
|
-
svgAlign = 'start';
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const fillString = `rgba(${fill[0]}, ${fill[1]}, ${fill[2]}, ${fill[3]})`
|
|
22
|
-
|
|
23
|
-
return `<text text-anchor="${svgAlign}" x="${scaleX(gameNode.node.text.x, container.x)}" y="${scaleX(gameNode.node.text.y, container.y)}" fill="${fillString}">${gameNode.node.text.text}</text>`;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const svgPolygon = (gameNode, container) => {
|
|
27
|
-
const coordPairs = gameNode.node.coordinates2d;
|
|
28
|
-
const fill = gameNode.node.fill;
|
|
29
|
-
|
|
30
|
-
const fillString = `rgba(${fill[0]}, ${fill[1]}, ${fill[2]}, ${fill[3]})`
|
|
31
|
-
|
|
32
|
-
const scaledCoords = coordPairs.map(coordPair => {
|
|
33
|
-
return [scaleX(coordPair[0], container.x), scaleY(coordPair[1], container.y)];
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
return `<polygon points="${scaledCoords.join(' ')}"
|
|
37
|
-
fill="${fillString}" stroke="black" />`;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const scaleX = (x, containerWidth) => {
|
|
41
|
-
const widthPercentage = x / 100;
|
|
42
|
-
return widthPercentage * containerWidth;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const scaleY = (y, containerHeight) => {
|
|
46
|
-
const heightPercentage = y / 100;
|
|
47
|
-
return heightPercentage * containerHeight;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const svgHelper = (gameNode, container) => {
|
|
51
|
-
|
|
52
|
-
if (gameNode.node.subType === subtypes.SHAPE_2D_POLYGON) {
|
|
53
|
-
console.log('sdfdsfdsf');
|
|
54
|
-
return svgPolygon(gameNode, container);
|
|
55
|
-
} else if (gameNode.node.subType === subtypes.SHAPE_2D_LINE) {
|
|
56
|
-
// svgString += svgPolygon(gameNode);
|
|
57
|
-
} else if (gameNode.node.subType === subtypes.SHAPE_2D_CIRCLE) {
|
|
58
|
-
// svgString += svgPolygon(gameNode);
|
|
59
|
-
} else if (gameNode.node.subType === subtypes.ASSET) {
|
|
60
|
-
// svgString += svgPolygon(gameNode);
|
|
61
|
-
} else if (gameNode.node.subType === subtypes.TEXT) {
|
|
62
|
-
console.log('yooooo his dgjdf top of the morning');
|
|
63
|
-
return svgText(gameNode, container);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// for (let i = 0; i < gameNode.node.children.length; i++) {
|
|
67
|
-
// svgHelper(gameNode.node.children[i], container, svgString);
|
|
68
|
-
// }
|
|
69
|
-
|
|
70
|
-
// return svgString;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
module.exports = (squishedLayers, outFile) => {
|
|
74
|
-
const pageWidth = 600;
|
|
75
|
-
const pageHeight = 600;
|
|
76
|
-
let svgString = `<svg height="${pageHeight}" width="${pageWidth}" xmlns="http://www.w3.org/2000/svg" xmlns:xlink= "http://www.w3.org/1999/xlink">`;
|
|
77
|
-
// <circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />
|
|
78
|
-
// </svg>`;
|
|
79
|
-
const container = { x: pageWidth, y: pageHeight };
|
|
80
|
-
squishedLayers.forEach(squishedNode => {
|
|
81
|
-
console.log('squished node');
|
|
82
|
-
console.log(squishedNode);
|
|
83
|
-
const node = unsquish(squishedNode);
|
|
84
|
-
svgString += svgHelper(node, container);
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
svgString += `</svg>`
|
|
88
|
-
fs.writeFileSync(outFile, svgString);
|
|
89
|
-
};
|
package/render-tester.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
console.log('ytoooo');
|
|
2
|
-
|
|
3
|
-
const canvas = document.getElementById('tester-canvas');
|
|
4
|
-
|
|
5
|
-
const ctx = canvas.getContext('2d');
|
|
6
|
-
|
|
7
|
-
const scaleCoordinate = ({ x, y }) => {
|
|
8
|
-
const xPercentage = x / 100;
|
|
9
|
-
const yPercentage = y / 100;
|
|
10
|
-
|
|
11
|
-
return {
|
|
12
|
-
scaledX: xPercentage * canvas.width,
|
|
13
|
-
scaledY: yPercentage * canvas.height
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
let thingToRender = [
|
|
19
|
-
[
|
|
20
|
-
3, 36, 2, 43, 3, 0, 44, 2, 52,
|
|
21
|
-
22, 5, 0, 5, 0, 95, 0, 5, 0,
|
|
22
|
-
95, 0, 95, 0, 5, 0, 95, 0, 5,
|
|
23
|
-
0, 5, 0, 53, 6, 255, 0, 0, 255
|
|
24
|
-
],
|
|
25
|
-
[
|
|
26
|
-
3, 36, 2, 43, 3, 1, 44, 2, 52,
|
|
27
|
-
22, 5, 0, 5, 0, 50, 0, 5, 0,
|
|
28
|
-
50, 0, 50, 0, 5, 0, 50, 0, 5,
|
|
29
|
-
0, 5, 0, 53, 6, 0, 0, 255, 255
|
|
30
|
-
],
|
|
31
|
-
[
|
|
32
|
-
3, 36, 2, 43, 3, 2, 44, 2, 52,
|
|
33
|
-
22, 50, 0, 5, 0, 95, 0, 5, 0,
|
|
34
|
-
95, 0, 50, 0, 50, 0, 50, 0, 50,
|
|
35
|
-
0, 5, 0, 53, 6, 0, 255, 0, 255
|
|
36
|
-
],
|
|
37
|
-
[
|
|
38
|
-
3, 36, 2, 43, 3, 3, 44, 2, 52,
|
|
39
|
-
22, 50, 0, 50, 0, 95, 0, 50, 0,
|
|
40
|
-
95, 0, 95, 0, 50, 0, 95, 0, 50,
|
|
41
|
-
0, 50, 0, 53, 6, 0, 0, 0, 255
|
|
42
|
-
],
|
|
43
|
-
[
|
|
44
|
-
3, 36, 2, 43, 3, 4, 44, 2, 52,
|
|
45
|
-
22, 5, 0, 50, 0, 50, 0, 50, 0,
|
|
46
|
-
50, 0, 95, 0, 5, 0, 95, 0, 5,
|
|
47
|
-
0, 50, 0, 53, 6, 255, 255, 255, 255
|
|
48
|
-
]
|
|
49
|
-
];
|
|
50
|
-
|
|
51
|
-
const drawMarker = ({ x, y, horizontal }) => {
|
|
52
|
-
const { scaledX, scaledY } = scaleCoordinate({ x, y });
|
|
53
|
-
|
|
54
|
-
if (horizontal) {
|
|
55
|
-
const lineWidth = .015 * canvas.width;
|
|
56
|
-
ctx.beginPath();
|
|
57
|
-
ctx.moveTo(scaledX, scaledY);
|
|
58
|
-
ctx.lineTo(scaledX + lineWidth, scaledY);
|
|
59
|
-
ctx.stroke();
|
|
60
|
-
} else {
|
|
61
|
-
// line is 1.5% of height
|
|
62
|
-
const lineHeight = .015 * canvas.height;
|
|
63
|
-
ctx.beginPath();
|
|
64
|
-
ctx.moveTo(scaledX, scaledY);
|
|
65
|
-
ctx.lineTo(scaledX, scaledY + lineHeight);
|
|
66
|
-
ctx.stroke();
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const drawMarkers = () => {
|
|
71
|
-
const horizontalPoints = [
|
|
72
|
-
[0, 10],
|
|
73
|
-
[0, 20],
|
|
74
|
-
[0, 30],
|
|
75
|
-
[0, 40],
|
|
76
|
-
[0, 50],
|
|
77
|
-
[0, 60],
|
|
78
|
-
[0, 70],
|
|
79
|
-
[0, 80],
|
|
80
|
-
[0, 90]
|
|
81
|
-
];
|
|
82
|
-
|
|
83
|
-
const verticalPoints = [
|
|
84
|
-
[10, 0],
|
|
85
|
-
[20, 0],
|
|
86
|
-
[30, 0],
|
|
87
|
-
[40, 0],
|
|
88
|
-
[50, 0],
|
|
89
|
-
[60, 0],
|
|
90
|
-
[70, 0],
|
|
91
|
-
[80, 0],
|
|
92
|
-
[90, 0]
|
|
93
|
-
];
|
|
94
|
-
|
|
95
|
-
verticalPoints.forEach(coord => {
|
|
96
|
-
drawMarker({x: coord[0], y: coord[1], horizontal: false });
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
horizontalPoints.forEach(coord => {
|
|
100
|
-
drawMarker({x: coord[0], y: coord[1], horizontal: true });
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
const drawThing = () => {
|
|
106
|
-
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
const draw = () => {
|
|
110
|
-
canvas.width = window.innerWidth;
|
|
111
|
-
canvas.height = window.innerHeight;
|
|
112
|
-
|
|
113
|
-
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
114
|
-
drawMarkers();
|
|
115
|
-
drawThing();
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
draw();
|
|
119
|
-
|
|
120
|
-
window.addEventListener('resize', draw);
|
package/test/StateUpdates.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
const { COLORS } = require("../src/Colors");
|
|
2
|
-
const assert = require("assert");
|
|
3
|
-
const Squisher = require('../src/Squisher');
|
|
4
|
-
const { unsquish } = require('../src/squish');
|
|
5
|
-
|
|
6
|
-
const { FakeGame, verifyArrayEquality, rectNode, polygonNode, circleNode } = require('./utils');
|
|
7
|
-
|
|
8
|
-
test("two layers - square over square", () => {
|
|
9
|
-
console.log("two layers - one square over another");
|
|
10
|
-
});
|
package/testapp.html
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE HTML>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<title>Homegames</title>
|
|
6
|
-
</head>
|
|
7
|
-
<body>
|
|
8
|
-
<div>
|
|
9
|
-
<canvas id='tester-canvas'></canvas>
|
|
10
|
-
</div>
|
|
11
|
-
</body>
|
|
12
|
-
<script src="src/squish.js"></script>
|
|
13
|
-
<script src="render-tester.js"></script>
|
|
14
|
-
<style>
|
|
15
|
-
|
|
16
|
-
body {
|
|
17
|
-
margin: 0;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
canvas, body {
|
|
21
|
-
width: 100vw;
|
|
22
|
-
height: 100vh;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
</style>
|
|
26
|
-
</html>
|