////Valerie - 2-10-2014 ////Project 2 - Create a book ////++++ String title="M Y B O O K (V 2.4)"; String mytitle="My first"; String mytitle1="book dedicated"; String mytitle2="to Dave S."; String author= "Valerie Courgis"; String mytitles="The LORD"; String mytitles1="is my shepherd"; String mytitles2="I shallnot want"; float bookL=100, bookT=150, bookR=200, bookB=400; float bookM=bookL+200, bookN=bookT; float pages; float horizon; int score=0; void setup() { //initialization// size(600,480); horizon= height/4; textSize(8.4); } void draw() { background(100,100,255); book(); pages(); notes(); } void mousePressed() { //// Event handler for mouse click. score= score + 1; } void book() { fill(204, 102, 0); stroke(5); strokeWeight(10); rectMode(CORNERS); rect(bookL, bookT, bookR,bookB); rect(bookM, bookN, bookR,bookB); } void pages() { // stroke(10); // strokeWeight( random(3) ); // stroke( 5+random(70), random(5), random(5) ); // strokeWeight( random(3) ); fill(255,0,255); ////left pages of book line(bookL+20, bookR-50, bookT-30,bookB); line(bookL+10, bookR-50, bookT-40,bookB); line(bookL+30, bookR-50, bookT-20,bookB); ////right pages of book line(bookL+180, bookR-50, bookT+130,bookB); line(bookL+190, bookR-50, bookT+140,bookB); line(bookL+170, bookR-50, bookT+120,bookB); smooth(); } void notes() { //// Messages on screen fill(0); text( title, 200, 30 ); text( score, width-100, 60 ); text( author, 20, height-20 ); //Messages on book pages on left//// text( mytitle, width-468, height-310 ); text( mytitle1, width-468, height-300 ); text( mytitle2, width-468, height-290 ); text( mytitle, width-468, height-280 ); text( mytitle1, width-468, height-270 ); text( mytitle2, width-468, height-260 ); text( mytitle, width-468, height-250 ); text( mytitle1, width-468, height-240 ); text( mytitle2, width-468, height-230 ); text( mytitle, width-468, height-220 ); text( mytitle1, width-468, height-210 ); text( mytitle2, width-468, height-200 ); text( mytitle, width-468, height-190 ); text( mytitle1, width-468, height-180 ); text( mytitle2, width-468, height-170 ); text( mytitle, width-468, height-160 ); text( mytitle1, width-468, height-150 ); text( mytitle2, width-468, height-140 ); //Messages on book pages on right//// text( mytitles, width-390, height-310 ); text( mytitles1, width-390, height-300 ); text( mytitles2, width-390, height-290 ); text( mytitles, width-390, height-280 ); text( mytitles1, width-390, height-270 ); text( mytitles2, width-390, height-260 ); text( mytitles, width-390, height-250 ); text( mytitles1, width-390, height-240 ); text( mytitles2, width-390, height-230 ); text( mytitles, width-390, height-220 ); text( mytitles1, width-390, height-210 ); text( mytitles2, width-390, height-200 ); text( mytitles, width-390, height-190 ); text( mytitles1, width-390, height-180 ); text( mytitles2, width-390, height-170 ); text( mytitles, width-390, height-160 ); text( mytitles1, width-390, height-150 ); text( mytitles2, width-390, height-140 ); }