using 'cell' to describe shapes instead of raw object

This commit is contained in:
Gavin McDonald
2016-02-19 09:51:08 -05:00
parent c3e5995bf1
commit ccd9cdb111
6 changed files with 77 additions and 48 deletions

View File

@@ -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
}));
}
});