Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 6 bytes modified

beta.r3js.org
-=yb4f310 2018-03-20 14:41:09 +01:00
parent da3c2c3b36
commit 7d1a0dc34f
1 changed files with 16 additions and 12 deletions

View File

@ -83,18 +83,22 @@ GameLib.CustomCode.prototype.visualizeGrid = function (color) {
this.starsGeometry = new THREE.Geometry();
for (var y = 0; y < this.grid.length; y++) {
for (var x = 0; x < this.grid[y].length; x++) {
this.starsGeometry.vertices.push(
new THREE.Vector3(
x + GameLib.CustomCode.GRID_OFFSET_X,
y + GameLib.CustomCode.GRID_OFFSET_Y,
5
)
);
}
}
this.grid.map(
function(x) {
this.grid[x].map(
function(y) {
this.starsGeometry.vertices.push(
new THREE.Vector3(
x + GameLib.CustomCode.GRID_OFFSET_X,
y + GameLib.CustomCode.GRID_OFFSET_Y,
5
)
);
}.bind(this)
)
}.bind(this)
);
var starsMaterial = new THREE.PointsMaterial({color: color, size: 0.1});
this.starsMesh = new THREE.Points(this.starsGeometry, starsMaterial);