Skip to content

Instantly share code, notes, and snippets.

@playdeezgames
Created August 9, 2018 10:41
Show Gist options
  • Save playdeezgames/0e1ea21f32ab11c23ffd5c3b492c806e to your computer and use it in GitHub Desktop.
Save playdeezgames/0e1ea21f32ab11c23ffd5c3b492c806e to your computer and use it in GitHub Desktop.
Nothingland in Processing
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