Pips! (#8)
This commit is contained in:
25
src/main.js
25
src/main.js
@@ -63,16 +63,24 @@ class Demo {
|
||||
}
|
||||
|
||||
onTap(tap) {
|
||||
console.log(tap.tile.getPoint());
|
||||
const {x, y, z} = tap.tile.getPoint();
|
||||
console.log(x, y, z);
|
||||
|
||||
this.taps.push(this.createTile(
|
||||
tap.tile.x,
|
||||
tap.tile.y,
|
||||
const key = `${ x },${ z != null ? z : y }`;
|
||||
|
||||
Tessellate.utils.random(Tessellate.DRAW_STYLES),
|
||||
Tessellate.utils.random(Tessellate.TILE_STYLES),
|
||||
Tessellate.utils.random(Tessellate.TILE_ORIENTATIONS),
|
||||
));
|
||||
this.map[key].pips = Tessellate.utils.random(1,9);
|
||||
console.log(this.map[key].pips);
|
||||
|
||||
// console.log(tap.tile.getPoint());
|
||||
//
|
||||
// this.taps.push(this.createTile(
|
||||
// tap.tile.x,
|
||||
// tap.tile.y,
|
||||
//
|
||||
// Tessellate.utils.random(Tessellate.DRAW_STYLES),
|
||||
// Tessellate.utils.random(Tessellate.TILE_STYLES),
|
||||
// Tessellate.utils.random(Tessellate.TILE_ORIENTATIONS),
|
||||
// ));
|
||||
}
|
||||
|
||||
createTile(x, y, drawStyle, tileStyle, orientation) {
|
||||
@@ -101,6 +109,7 @@ class Demo {
|
||||
const pixelPoint = this.tessellate.tileToPixel(x, y, z);
|
||||
|
||||
Tessellate.TILES[tile.tileStyle][tile.drawStyle](context, scale, pixelPoint.getX(), pixelPoint.getY(), tile);
|
||||
Tessellate.TILES[tile.tileStyle].pips(context, scale, pixelPoint.getX(), pixelPoint.getY(), tile);
|
||||
}
|
||||
|
||||
draw({context, scale, tilePoints}) {
|
||||
|
||||
Reference in New Issue
Block a user