void click_to_next_page () {
- switch (SwitchFunction) {
+////////////////Variable////////////////////////////////////
+if (mousePressed&&(mouseX>=x2-50 && mouseX<= width) && (mouseY >= y2-50 && mouseY <= y2+150)) {
+////////////////conditions////////////////////////////////////
+if (mousePressed&&(mouseX>=50 && mouseX<= x1+60) && (mouseY >= 100 && mouseY <= y1+60)) {
+////////////////function////////////////////////////////////
+if (mousePressed&&(mouseX>=posX2+50 && mouseX<= width) && (mouseY >= posY2-230 && mouseY <= posY2-100)) {
+////////////////array////////////////////////////////////
+if (mousePressed&&(mouseX>=150 && mouseX<= turtleX+100) && (mouseY >= turtleY-90 && mouseY <= height)) {
+////////////////practice////////////////////////////////////
+if (mousePressed&&(mouseX>=posX1-50 && mouseX<= width-200) && (mouseY >= posY1-20 && mouseY <= height)) {
- #F296F7, #0DB4FF, #FFA850, #3DE858
- fill(random(0, 255), random(0, 255), random(0, 255));
- ellipse(random(0, width), random(0, height), 10, 10);
- text("Programming Fundamentals", 245, 110);
- text("Chalita Ganjanmuang", 290, 260);
- text("Unthika Nongbua", 320, 340);
- ButtonChangePage(800, 600, "Click!");
- for (int i=0; i<c.length; i++) {
- drawPooH(x, 480, c[i]);
+#F296F7, #0DB4FF, #FFA850, #3DE858
+fill(random(0, 255), random(0, 255), random(0, 255));
+ellipse(random(0, width), random(0, height), 10, 10);
+text("Programming Fundamentals", 245, 110);
+text("Chalita Ganjanmuang", 290, 260);
+text("Unthika Nongbua", 320, 340);
+ButtonChangePage(800, 600, "Click!");
+for (int i=0; i<c.length; i++) {
+void ButtonChangePage(int x, int y, String s) {
+rect(x-100, y-10, 100, 30);
+triangle(x, y-20, x, y+30, x+30, y);
void drawPooH(int x, int y, color c) {
- ellipse(x-50, y-50, 50, 50); //ears
- ellipse(x+50, y-50, 50, 50);
- ellipse(x, y, 150, 120); //body
- ellipse(x-30, y-5, 20, 20); //eye
- ellipse(x+30, y-5, 20, 20);
- ellipse(x, y+25, 20, 20); //nose
+ellipse(x-50, y-50, 50, 50); //ears
+ellipse(x+50, y-50, 50, 50);
+ellipse(x, y, 150, 120); //body
+ellipse(x-30, y-5, 20, 20); //eye
+ellipse(x+30, y-5, 20, 20);
+ellipse(x, y+25, 20, 20); //nose
-void ButtonChangePage(int x, int y, String s) {
- rect(x-100, y-10, 100, 30);
- triangle(x, y-20, x, y+30, x+30, y);
+background (153, 255, 255);
+ellipse (width/2, height, width, height/2);
+text ("Menu", (width/2)-70, 75);
+text ("Click on the title", (width/2)-200, 300);
+text (" to access the lessons", (width/2)-250, 350);
+Menu_Chicken(width-300, height-140, 30);
+Menu_Balloon(x1, y1, size);
+if ((mouseX>=50 && mouseX<= x1+60) && (mouseY >= 100 && mouseY <= y1+60)) {
- background (153, 255, 255);
- ellipse (width/2, height, width, height/2);
- text ("Menu", (width/2)-70, 75);
- text ("Click on the title", (width/2)-200, 300);
- text (" to access the lessons", (width/2)-250, 350);
- Menu_Chicken(width-300, height-140, 30);
+if ((mouseX>=x2-50 && mouseX<= width) && (mouseY >= y2-50 && mouseY <= y2+150)) {
- Menu_Balloon(x1, y1, size);
- if ((mouseX>=50 && mouseX<= x1+60) && (mouseY >= 100 && mouseY <= y1+60)) {
- if ((mouseX>=x2-50 && mouseX<= width) && (mouseY >= y2-50 && mouseY <= y2+150)) {
- Menu_Turtle (turtleX, turtleY);
- if ((mouseX>=150 && mouseX<= turtleX+100) && (mouseY >= turtleY-90 && mouseY <= height)) {
- Menu_Tree (50, height-200, 150);
- Menu_Pencil (posX1, posY1);
- if ((mouseX>=posX1-50 && mouseX<= width-200) && (mouseY >= posY1-20 && mouseY <= height)) {
- Menu_Tree (50, height-200, 150);
- ellipse (posX2+150, posY2-180, r2, r2-50);
- text ("Functions", posX2+80, posY2-170);
- if ((mouseX>=posX2+50 && mouseX<= width) && (mouseY >= posY2-230 && mouseY <= posY2-100)) {
+Menu_Turtle (turtleX, turtleY);
+if ((mouseX>=150 && mouseX<= turtleX+100) && (mouseY >= turtleY-90 && mouseY <= height)) {
+Menu_Tree (50, height-200, 150);
+Menu_Pencil (posX1, posY1);
+if ((mouseX>=posX1-50 && mouseX<= width-200) && (mouseY >= posY1-20 && mouseY <= height)) {
+Menu_Tree (50, height-200, 150);
+ellipse (posX2+150, posY2-180, r2, r2-50);
+text ("Functions", posX2+80, posY2-170);
+if ((mouseX>=posX2+50 && mouseX<= width) && (mouseY >= posY2-230 && mouseY <= posY2-100)) {
ไม่มีความคิดเห็น:
แสดงความคิดเห็น