Updated Toy

This commit is contained in:
2023-03-11 18:13:38 +11:00
parent 6537f308d2
commit c4bd1f20d2
5 changed files with 7 additions and 7 deletions

View File

@@ -100,7 +100,7 @@ fn generateLevel(node: opaque, seed: int, width: int, height: int) {
var y = 0;
//while generated spot is a collision, or too close to the player
while ((x == 0 && y == 0) || node.getCollisionAt(x, y) == false || (x < (width / 6 * 2) && y < (height / 6 * 2))) { //TODO: toy bug - no short-circuiting?
while (x == 0 && y == 0 || node.getCollisionAt(x, y) == false || x < width / 6 * 2 && y < height / 6 * 2) {
x = rng.generateRandomNumber() % width;
y = rng.generateRandomNumber() % height;
}