PImage nightWatchman;
PImage tree1;
PImage background;
float tLidPos; //top eyelid position
float bLidPos; //bottom eyelid position
float bookXPos; //book position along shelves
float bookYPos; //shelf position
float bookHeight = 0;
float count=0;
float[] bookList;
void setup() {
size(800, 800);
background(150, 0, 0);
nightWatchman = loadImage("nightWatchman2.png");
background = loadImage("background.png");
tree1 = loadImage("tree1.png");
}
void draw() {
noStroke();
image(background, 0, 0);
//books
drawBooks();
//eyes
fill(255);
ellipse(655, 287, 35, 35);
ellipse(703, 287, 35, 35);
fill(0);
ellipse(655, 287, 15, 15);
ellipse(703, 287, 15, 15);
//eyeLids
fill(230, 198, 177);
if (eyeLids == true) {
for (int i=0; i<20; i++) {
//top eyelids
tLidPos = 251+i;
rect(638, tLidPos, 35, 20);
rect(686, tLidPos, 35, 20);
}
for (int b=0; b<15; b++) {
//bottom eyelids
bLidPos = 304-b;
stroke(200, 156, 132);
rect(638, bLidPos, 35, 15);
rect(686, bLidPos, 35, 15);
}
}
//night watchman
image(nightWatchman, 0, 0);
//text box and text
fill(255);
rect(50, 600, 700, 150);
fill(0);
pageText = " hen the library is closed and the night watchman has fallen asleep ";
pageText += "in his big armchair, the shelves come to life. Doors and windows appear on ";
pageText += "the backs of the books, lights come on, and the sound of voices drifts out ";
pageText += "between the pages. Full grown trees spring up and chimneys begin to smoke. ";
pageText += "Staircases and ladders join the shelves into great cities, and in the distance ";
pageText += "small dogs bark.";
textSize(27);
text("W", 71, 635);
textSize(15);
text(pageText, 70, 620, 670, 140);
noStroke();
ellipse(mouseX, mouseY, 30, 30);
}
void mouseClicked() {
if (mouseX >= 544 && mouseX <=800 && mouseY >=200 && mouseY<800) {
eyeLids = true;
count++;
redraw();
}
}
void drawWindow(float x, float y) {
fill(255, 232, 71);
rect(x, y, 20, 30);
stroke(111, 71, 23);
line(x, y, x+20, y);
line(x, y+30, x+20, y+30);
line(x, y, x, y+30);
line(x+20, y, x+20, y+30);
line(x+10, y, x+10, y+30);
line(x, y+15, x+20, y+15);
}
void drawBooks() {
for (int j=0; j<17; j++) {
for (int n=0; n<3; n++) {
fill(random(100, 255), 101, 100);
bookXPos = j*44 +27;
bookYPos = n*255 +258;
bookHeight = random(190, 221);
bookList = new float[17];
bookList[0] = bookHeight;
bookList[1] = bookHeight;
bookList[2] = bookHeight;
bookList[3] = bookHeight;
bookList[4] = bookHeight;
bookList[5] = bookHeight;
bookList[6] = bookHeight;
bookList[7] = bookHeight;
bookList[8] = bookHeight;
bookList[9] = bookHeight;
bookList[10] = bookHeight;
bookList[11] = bookHeight;
bookList[12] = bookHeight;
bookList[13] = bookHeight;
bookList[14] = bookHeight;
bookList[15] = bookHeight;
bookList[16] = bookHeight;
//tells the program not to draw books between these coordinates
if (bookXPos >= 150 && bookXPos <=320 && bookYPos >= 283 && bookYPos <= 514) {
books=false;
}
else {
books=true;
}
//everywhere else, draw books
if (books == true) {
rect(bookXPos, bookYPos-bookList[j], 40, bookList[j]);
}
}
}
noLoop();
}
U3RyaW5nIHBhZ2VUZXh0OwpQSW1hZ2UgbmlnaHRXYXRjaG1hbjsKUEltYWdlIHRyZWUxOwpQSW1hZ2UgYmFja2dyb3VuZDsKQm9vbGVhbiBleWVMaWRzID0gZmFsc2U7CmZsb2F0IHRMaWRQb3M7IC8vdG9wIGV5ZWxpZCBwb3NpdGlvbgpmbG9hdCBiTGlkUG9zOyAvL2JvdHRvbSBleWVsaWQgcG9zaXRpb24KZmxvYXQgYm9va1hQb3M7IC8vYm9vayBwb3NpdGlvbiBhbG9uZyBzaGVsdmVzCmZsb2F0IGJvb2tZUG9zOyAvL3NoZWxmIHBvc2l0aW9uCmZsb2F0IGJvb2tIZWlnaHQgPSAwOwpCb29sZWFuIGJvb2tzID0gdHJ1ZTsKZmxvYXQgY291bnQ9MDsKCmZsb2F0W10gYm9va0xpc3Q7CgoKdm9pZCBzZXR1cCgpIHsKICBzaXplKDgwMCwgODAwKTsKICBiYWNrZ3JvdW5kKDE1MCwgMCwgMCk7CiAgbmlnaHRXYXRjaG1hbiA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SBib29rSGVpZ2h0OyAKICAgICAgYm9va0xpc3RbOV0gPSBib29rSGVpZ2h0OyAKICAgICAgYm9va0xpc3RbMTBdID0gYm9va0hlaWdodDsgCiAgICAgIGJvb2tMaXN0WzExXSA9IGJvb2tIZWlnaHQ7IAogICAgICBib29rTGlzdFsxMl0gPSBib29rSGVpZ2h0OyAKICAgICAgYm9va0xpc3RbMTNdID0gYm9va0hlaWdodDsKICAgICAgYm9va0xpc3RbMTRdID0gYm9va0hlaWdodDsKICAgICAgYm9va0xpc3RbMTVdID0gYm9va0hlaWdodDsKICAgICAgYm9va0xpc3RbMTZdID0gYm9va0hlaWdodDsKCgogICAgICAvL3RlbGxzIHRoZSBwcm9ncmFtIG5vdCB0byBkcmF3IGJvb2tzIGJldHdlZW4gdGhlc2UgY29vcmRpbmF0ZXMKICAgICAgaWYgKGJvb2tYUG9zID49IDE1MCAmJiBib29rWFBvcyA8PTMyMCAmJiBib29rWVBvcyA+PSAyODMgJiYgYm9va1lQb3MgPD0gNTE0KSB7CiAgICAgICAgYm9va3M9ZmFsc2U7CiAgICAgIH0KICAgICAgZWxzZSB7CiAgICAgICAgYm9va3M9dHJ1ZTsKICAgICAgfQoKICAgICAgLy9ldmVyeXdoZXJlIGVsc2UsIGRyYXcgYm9va3MKICAgICAgaWYgKGJvb2tzID09IHRydWUpIHsKICAgICAgICByZWN0KGJvb2tYUG9zLCBib29rWVBvcy1ib29rTGlzdFtqXSwgNDAsIGJvb2tMaXN0W2pdKTsKICAgICAgfQogICAgfQogIH0KICBub0xvb3AoKTsKfQo=
Main.java:1: error: class, interface, or enum expected
String pageText;
^
Main.java:2: error: class, interface, or enum expected
PImage nightWatchman;
^
Main.java:3: error: class, interface, or enum expected
PImage tree1;
^
Main.java:4: error: class, interface, or enum expected
PImage background;
^
Main.java:5: error: class, interface, or enum expected
Boolean eyeLids = false;
^
Main.java:6: error: class, interface, or enum expected
float tLidPos; //top eyelid position
^
Main.java:7: error: class, interface, or enum expected
float bLidPos; //bottom eyelid position
^
Main.java:8: error: class, interface, or enum expected
float bookXPos; //book position along shelves
^
Main.java:9: error: class, interface, or enum expected
float bookYPos; //shelf position
^
Main.java:10: error: class, interface, or enum expected
float bookHeight = 0;
^
Main.java:11: error: class, interface, or enum expected
Boolean books = true;
^
Main.java:12: error: class, interface, or enum expected
float count=0;
^
Main.java:14: error: class, interface, or enum expected
float[] bookList;
^
Main.java:17: error: class, interface, or enum expected
void setup() {
^
Main.java:19: error: class, interface, or enum expected
background(150, 0, 0);
^
Main.java:20: error: class, interface, or enum expected
nightWatchman = loadImage("nightWatchman2.png");
^
Main.java:21: error: class, interface, or enum expected
background = loadImage("background.png");
^
Main.java:22: error: class, interface, or enum expected
tree1 = loadImage("tree1.png");
^
Main.java:23: error: class, interface, or enum expected
}
^
Main.java:27: error: class, interface, or enum expected
image(background, 0, 0);
^
Main.java:30: error: class, interface, or enum expected
drawBooks();
^
Main.java:33: error: class, interface, or enum expected
fill(255);
^
Main.java:34: error: class, interface, or enum expected
ellipse(655, 287, 35, 35);
^
Main.java:35: error: class, interface, or enum expected
ellipse(703, 287, 35, 35);
^
Main.java:36: error: class, interface, or enum expected
fill(0);
^
Main.java:37: error: class, interface, or enum expected
ellipse(655, 287, 15, 15);
^
Main.java:38: error: class, interface, or enum expected
ellipse(703, 287, 15, 15);
^
Main.java:41: error: class, interface, or enum expected
fill(230, 198, 177);
^
Main.java:42: error: class, interface, or enum expected
if (eyeLids == true) {
^
Main.java:43: error: class, interface, or enum expected
for (int i=0; i<20; i++) {
^
Main.java:43: error: class, interface, or enum expected
for (int i=0; i<20; i++) {
^
Main.java:46: error: class, interface, or enum expected
rect(638, tLidPos, 35, 20);
^
Main.java:47: error: class, interface, or enum expected
rect(686, tLidPos, 35, 20);
^
Main.java:48: error: class, interface, or enum expected
}
^
Main.java:49: error: class, interface, or enum expected
for (int b=0; b<15; b++) {
^
Main.java:49: error: class, interface, or enum expected
for (int b=0; b<15; b++) {
^
Main.java:52: error: class, interface, or enum expected
stroke(200, 156, 132);
^
Main.java:53: error: class, interface, or enum expected
rect(638, bLidPos, 35, 15);
^
Main.java:54: error: class, interface, or enum expected
rect(686, bLidPos, 35, 15);
^
Main.java:55: error: class, interface, or enum expected
}
^
Main.java:62: error: class, interface, or enum expected
fill(255);
^
Main.java:63: error: class, interface, or enum expected
rect(50, 600, 700, 150);
^
Main.java:64: error: class, interface, or enum expected
fill(0);
^
Main.java:65: error: class, interface, or enum expected
pageText = " hen the library is closed and the night watchman has fallen asleep ";
^
Main.java:66: error: class, interface, or enum expected
pageText += "in his big armchair, the shelves come to life. Doors and windows appear on ";
^
Main.java:67: error: class, interface, or enum expected
pageText += "the backs of the books, lights come on, and the sound of voices drifts out ";
^
Main.java:68: error: class, interface, or enum expected
pageText += "between the pages. Full grown trees spring up and chimneys begin to smoke. ";
^
Main.java:69: error: class, interface, or enum expected
pageText += "Staircases and ladders join the shelves into great cities, and in the distance ";
^
Main.java:70: error: class, interface, or enum expected
pageText += "small dogs bark.";
^
Main.java:71: error: class, interface, or enum expected
textSize(27);
^
Main.java:72: error: class, interface, or enum expected
text("W", 71, 635);
^
Main.java:73: error: class, interface, or enum expected
textSize(15);
^
Main.java:74: error: class, interface, or enum expected
text(pageText, 70, 620, 670, 140);
^
Main.java:76: error: class, interface, or enum expected
noStroke();
^
Main.java:77: error: class, interface, or enum expected
ellipse(mouseX, mouseY, 30, 30);
^
Main.java:78: error: class, interface, or enum expected
}
^
Main.java:83: error: class, interface, or enum expected
count++;
^
Main.java:84: error: class, interface, or enum expected
redraw();
^
Main.java:85: error: class, interface, or enum expected
}
^
Main.java:90: error: class, interface, or enum expected
rect(x, y, 20, 30);
^
Main.java:91: error: class, interface, or enum expected
stroke(111, 71, 23);
^
Main.java:92: error: class, interface, or enum expected
line(x, y, x+20, y);
^
Main.java:93: error: class, interface, or enum expected
line(x, y+30, x+20, y+30);
^
Main.java:94: error: class, interface, or enum expected
line(x, y, x, y+30);
^
Main.java:95: error: class, interface, or enum expected
line(x+20, y, x+20, y+30);
^
Main.java:96: error: class, interface, or enum expected
line(x+10, y, x+10, y+30);
^
Main.java:97: error: class, interface, or enum expected
line(x, y+15, x+20, y+15);
^
Main.java:98: error: class, interface, or enum expected
}
^
Main.java:101: error: class, interface, or enum expected
for (int j=0; j<17; j++) {
^
Main.java:101: error: class, interface, or enum expected
for (int j=0; j<17; j++) {
^
Main.java:102: error: class, interface, or enum expected
for (int n=0; n<3; n++) {
^
Main.java:102: error: class, interface, or enum expected
for (int n=0; n<3; n++) {
^
Main.java:104: error: class, interface, or enum expected
bookXPos = j*44 +27;
^
Main.java:105: error: class, interface, or enum expected
bookYPos = n*255 +258;
^
Main.java:107: error: class, interface, or enum expected
bookHeight = random(190, 221);
^
Main.java:109: error: class, interface, or enum expected
bookList = new float[17];
^
Main.java:110: error: class, interface, or enum expected
bookList[0] = bookHeight;
^
Main.java:111: error: class, interface, or enum expected
bookList[1] = bookHeight;
^
Main.java:112: error: class, interface, or enum expected
bookList[2] = bookHeight;
^
Main.java:113: error: class, interface, or enum expected
bookList[3] = bookHeight;
^
Main.java:114: error: class, interface, or enum expected
bookList[4] = bookHeight;
^
Main.java:115: error: class, interface, or enum expected
bookList[5] = bookHeight;
^
Main.java:116: error: class, interface, or enum expected
bookList[6] = bookHeight;
^
Main.java:117: error: class, interface, or enum expected
bookList[7] = bookHeight;
^
Main.java:118: error: class, interface, or enum expected
bookList[8] = bookHeight;
^
Main.java:119: error: class, interface, or enum expected
bookList[9] = bookHeight;
^
Main.java:120: error: class, interface, or enum expected
bookList[10] = bookHeight;
^
Main.java:121: error: class, interface, or enum expected
bookList[11] = bookHeight;
^
Main.java:122: error: class, interface, or enum expected
bookList[12] = bookHeight;
^
Main.java:123: error: class, interface, or enum expected
bookList[13] = bookHeight;
^
Main.java:124: error: class, interface, or enum expected
bookList[14] = bookHeight;
^
Main.java:125: error: class, interface, or enum expected
bookList[15] = bookHeight;
^
Main.java:126: error: class, interface, or enum expected
bookList[16] = bookHeight;
^
Main.java:130: error: class, interface, or enum expected
if (bookXPos >= 150 && bookXPos <=320 && bookYPos >= 283 && bookYPos <= 514) {
^
Main.java:132: error: class, interface, or enum expected
}
^
Main.java:135: error: class, interface, or enum expected
}
^
Main.java:140: error: class, interface, or enum expected
}
^
Main.java:144: error: class, interface, or enum expected
}
^
98 errors