From 5fcd5ded4386ee1cf85acf231f5e41ceb9a5525f Mon Sep 17 00:00:00 2001 From: Sidibaba23 <142639349+Sidibaba23@users.noreply.github.com> Date: Thu, 4 Sep 2025 12:48:06 -0400 Subject: [PATCH 1/2] Create Makey_Makey_Platformer.pde MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Copy from main branch (copy paste 👍 ) --- code/Makey_Makey_Platformer.pde | 76 +++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 code/Makey_Makey_Platformer.pde diff --git a/code/Makey_Makey_Platformer.pde b/code/Makey_Makey_Platformer.pde new file mode 100644 index 0000000..769e777 --- /dev/null +++ b/code/Makey_Makey_Platformer.pde @@ -0,0 +1,76 @@ +PShape easyButton; +PShape mediumButton; +PShape hardButton; +PShape exitButton; +int screen; +void setup(){ + fullScreen(); + textAlign(CENTER,CENTER); + drawMainScreen(); +} + +void drawMainScreen(){ + screen = 0; + background(255); + String title = "Makey Makey Platformer"; + textSize(128); + fill(0, 0, 0); + text(title, width/2, height/4); + easyButton = drawButton(width/2 - 75, height/2, 150, 80, "Easy", 0, 170, 0); + mediumButton = drawButton(width/2 - 75, height/2 + 100, 150, 80, "Medium", 255, 255, 0); + hardButton = drawButton(width/2 - 75, height/2 + 200, 150, 80, "Hard", 255, 0, 0); + drawExit(); +} +void drawLevelSelect(){ + drawExit(); + +} +void drawExit(){ + exitButton = drawButton(0, height-80, 100, 80, "Exit", 255, 0, 0); +} + + PShape drawButton(int x, int y, int wide, int high, String name, int color1, int color2, int color3){ + PShape border = createShape(RECT, x, y, wide, high); + border.setFill(color(0,0,0)); + border.setStroke(false); + shape(border); + + PShape mainButton = createShape(RECT, x + 10, y + 10, wide - 20, high - 20); + mainButton.setFill(color(color1, color2, color3)); + mainButton.setStroke(false); + shape(mainButton); + + fill(0); + textSize(32); + text(name, x + wide/2, y + high/2); + + return mainButton; + } + + void mousePressed(){ + if(screen == 0 && overButton(width/2 - 75, height/2, 150, 80)){ + background(color(0, 170, 0)); + changeScreen(); + drawLevelSelect(); + } else if(screen == 0 && overButton(width/2 - 75, height/2 + 100, 150, 80)){ + background(color(255, 255, 0)); + changeScreen(); + drawLevelSelect(); + } else if(screen == 0 && overButton(width/2 - 75, height/2 + 200, 150, 80)){ + background(color(255, 0, 0)); + changeScreen(); + drawLevelSelect(); + } else if(screen == 0 && overButton(0, height-80, 100, 80)){ + exit(); + } else if(screen == 1 && overButton(0, height-80, 100, 80)){ + drawMainScreen(); + } + } + + boolean overButton(int x, int y, int w, int h) { + return (mouseX > x && mouseX < x + w && + mouseY > y && mouseY < y + h); +} +void changeScreen(){ + screen++; +} From ceb89333177e4c2a7c33fff3f5c9895c6e02894e Mon Sep 17 00:00:00 2001 From: Sidibaba23 <142639349+Sidibaba23@users.noreply.github.com> Date: Thu, 4 Sep 2025 13:19:41 -0400 Subject: [PATCH 2/2] Update Makey_Makey_Platformer.pde --- code/Makey_Makey_Platformer.pde | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/Makey_Makey_Platformer.pde b/code/Makey_Makey_Platformer.pde index 769e777..4c6dd07 100644 --- a/code/Makey_Makey_Platformer.pde +++ b/code/Makey_Makey_Platformer.pde @@ -9,6 +9,10 @@ void setup(){ drawMainScreen(); } +void draw(){ + +} + void drawMainScreen(){ screen = 0; background(255);