Commit 6f69370e authored by Hubert Denkmair's avatar Hubert Denkmair
Browse files

fix worldrim mask

parent 25692059
......@@ -28,6 +28,8 @@ function GameVisualization(assets, snakeMoveStrategy, container)
this.foodContainer = this.viewport.addChild(new PIXI.Container());
this.snakesContainer = this.viewport.addChild(new PIXI.Container());
this.snakesMask = this.viewport.addChild(new PIXI.Graphics());
this.snakesContainer.mask = this.snakesMask;
this.UpdateMask();
this.segmentPool = new ObjectPool(function() {
......@@ -41,12 +43,11 @@ function GameVisualization(assets, snakeMoveStrategy, container)
GameVisualization.prototype.UpdateMask = function()
{
/* const mask = new PIXI.Graphics();
mask.lineStyle(0);
mask.beginFill(0x000000, 0.5);
mask.drawRect(0, 0, this.world_size_x, this.world_size_y);
mask.endFill();
this.snakesContainer.mask = mask; */
this.snakesMask.clear();
this.snakesMask.lineStyle(0);
this.snakesMask.beginFill(0x000000, 0.5);
this.snakesMask.drawRect(0, 0, this.world_size_x, this.world_size_y);
this.snakesMask.endFill();
};
GameVisualization.prototype.Run = function()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment