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) ...@@ -28,6 +28,8 @@ function GameVisualization(assets, snakeMoveStrategy, container)
this.foodContainer = this.viewport.addChild(new PIXI.Container()); this.foodContainer = this.viewport.addChild(new PIXI.Container());
this.snakesContainer = 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.UpdateMask();
this.segmentPool = new ObjectPool(function() { this.segmentPool = new ObjectPool(function() {
...@@ -41,12 +43,11 @@ function GameVisualization(assets, snakeMoveStrategy, container) ...@@ -41,12 +43,11 @@ function GameVisualization(assets, snakeMoveStrategy, container)
GameVisualization.prototype.UpdateMask = function() GameVisualization.prototype.UpdateMask = function()
{ {
/* const mask = new PIXI.Graphics(); this.snakesMask.clear();
mask.lineStyle(0); this.snakesMask.lineStyle(0);
mask.beginFill(0x000000, 0.5); this.snakesMask.beginFill(0x000000, 0.5);
mask.drawRect(0, 0, this.world_size_x, this.world_size_y); this.snakesMask.drawRect(0, 0, this.world_size_x, this.world_size_y);
mask.endFill(); this.snakesMask.endFill();
this.snakesContainer.mask = mask; */
}; };
GameVisualization.prototype.Run = function() GameVisualization.prototype.Run = function()
......
Supports Markdown
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