using 'cell' to describe shapes instead of raw object
This commit is contained in:
@@ -9,6 +9,8 @@ import TileCircle from './tileCircle.js';
|
||||
import TileHex from './tileHex.js';
|
||||
import TileSquare from './tileSquare.js';
|
||||
|
||||
import Cell from './cell.js';
|
||||
|
||||
export default class Tessellate {
|
||||
constructor(settings) {
|
||||
['draw'].map(method => {this[method] = this[method].bind(this)});
|
||||
@@ -31,15 +33,19 @@ export default class Tessellate {
|
||||
let styles = ['filled', 'outline'];
|
||||
let scale = random(10, 50);
|
||||
|
||||
this.map.push({
|
||||
this.map.push(new Cell({
|
||||
tile: tiles[random(tiles.length-1)],
|
||||
style: styles[random(styles.length-1)],
|
||||
name: 'gavin',
|
||||
x,
|
||||
y,
|
||||
scale,
|
||||
pointy: random(1) ? true : false,
|
||||
color: `rgba(${ random(255) }, ${ random(255) }, ${ random(255) }, 0.5)`
|
||||
});
|
||||
pointyTop: random(1) ? true : false,
|
||||
red: random(255),
|
||||
green: random(255),
|
||||
blue: random(255),
|
||||
alpha: 0.5
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user