Created
June 27, 2020 18:33
-
-
Save lethern/e8ea6a534d425689f0bf8c3276da8f44 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function renderMatrix(roomName, costMatrix, color = '#ff0000') { | |
var vis = Game.rooms[roomName].visual; | |
const array = costMatrix._bits; | |
var max = _.max(array); | |
for (var x = 0; x < 50; ++x) { | |
for (var y = 0; y < 50; ++y) { | |
var value = array[x * 50 + y]; | |
if (value > 0) { | |
vis.circle(x, y, { radius: value / max / 2, fill: color }); | |
//vis.text(value, x, y); | |
} | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment