Created
August 9, 2018 10:41
-
-
Save playdeezgames/0e1ea21f32ab11c23ffd5c3b492c806e to your computer and use it in GitHub Desktop.
Nothingland in Processing
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
final int CELL_WIDTH = 32; | |
final int CELL_HEIGHT = 32; | |
World world = new World(); | |
void settings(){ | |
size(world.columns * CELL_WIDTH, world.rows * CELL_HEIGHT); | |
} | |
void draw(){ | |
for(int column=0;column<world.columns;++column){ | |
for(int row=0;row<world.rows;++row){ | |
int plotX = column * CELL_WIDTH; | |
int plotY = row * CELL_HEIGHT; | |
stroke(192); | |
fill(128); | |
rect(plotX,plotY,CELL_WIDTH,CELL_HEIGHT); | |
} | |
} | |
} | |
void keyPressed(){ | |
if(key==ESC){ | |
exit(); | |
} | |
} | |
class World{ | |
int columns = 8; | |
int rows = 8; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment