Created
March 8, 2017 01:04
-
-
Save hanss314/107f8647c71cc4313e9b3df079921638 to your computer and use it in GitHub Desktop.
This file contains 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
public void rotSymRandomize(int deadDensity){ | |
for(int x = 0; x<(WIDTH/2); x++){ //doesn't cover everything for odd widths, but it's good enough | |
for(int y = 0; y<HEIGHT; y++){ | |
Tile t = allTiles[x][y]; | |
Tile pair = allTiles[WIDTH-1-x][HEIGHT-1-y]; | |
int state = MathUtil.randInt(0,deadDensity*2) | |
switch(state){ | |
case 0: t.setState(1); | |
pair.setState(2); | |
break; | |
case 1: t.setState(2); | |
pair.setState(1); | |
break; | |
default:t.setState(0); | |
pair.setState(0); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment