collisionMatrix = new boolean[160][90]; | |
Pixmap backgroundMap = new Pixmap(Gdx.files.internal("data/warehouse-map.png")); | |
for (int y = 0; y < 90; y++) { | |
for (int x = 0; x < 160; x++) { | |
// Get the pixel, shifting off the alpha value | |
int pixel = backgroundMap.getPixel(x, y) >>> 8; | |
if (pixel == 0x000000) { | |
// true means impassible, also invert y to match our coordinate system | |
collisionMatrix[x][90 - y] = true; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment