From 2a2af21d0322d35ac2e272b0f0f133395490c976 Mon Sep 17 00:00:00 2001 From: Makussu Date: Fri, 22 Dec 2023 16:52:11 +0100 Subject: [PATCH] fix save file and branch --- files.pde | 1 + simulation.pde | 99 -------------------------------------------------- 2 files changed, 1 insertion(+), 99 deletions(-) delete mode 100644 simulation.pde diff --git a/files.pde b/files.pde index 07b0024..35e1ef0 100644 --- a/files.pde +++ b/files.pde @@ -17,6 +17,7 @@ class Files { } catch (Exception e) { println("Savefile not found"); + stats_menu.best_game_time = 90000; } } diff --git a/simulation.pde b/simulation.pde deleted file mode 100644 index 428155f..0000000 --- a/simulation.pde +++ /dev/null @@ -1,99 +0,0 @@ -boolean ismenu = true; -boolean isgame = false; -PVector pos = new PVector(220, 50); - -void setup() { - size(800,800); -} - -https://forum.processing.org/two/discussion/19925/rotating-an-object-and-making-it-move-with-a-variable.html -void draw() { - // debug(); - - if (ismenu) { - mainMenu(); - } else if (isgame) { - play(); - } -} - -int rotation; -void play() { - background(255); - - rotate(radians(rotation)); - translate(pos.x, pos.y); - rect(0, 0, 20, 20); -} - -void mainMenu() { - background(246, 244, 235); - - fill(116, 155, 194); - textSize(128); - textAlign(CENTER); - text("p4dash", width/2, height/2 - 100); - // go to game - fill(70, 130, 169); - if (drawRectWithMouseColission(width/2, height/2, 300, 100)) { - if (mousePressed) { - ismenu = false; - isgame = true; - } - } - fill(0); - textSize(40); - text("Play", width/2, height/2); - // go to editor - fill(70, 130, 169); - if (drawRectWithMouseColission(width/2, height/2+200, 300, 100)) { - if (mousePressed) { - ismenu = false; - } - } - fill(0); - textSize(40); - text("Editor", width/2, height/2+200); - fill(145, 200, 228); - // exit game - if (drawRectWithMouseColission(50, 100, 80, 40)) { - if (mousePressed) { - exit(); - } - } - fill(0); - textSize(40); - textAlign(CENTER); - text("Exit", 50, 110); -} - -// Rectangle with editor colission -boolean drawRectWithMouseColission(int x, int y, int rectwidth, int rectheight) { - // Draw A Rect - rectMode(CENTER); - rect(x, y, rectwidth, rectheight); - - // Check it for collission - if((mouseX > x - rectwidth/2 && mouseX < x + rectwidth/2) && (mouseY > y - rectheight/2 && mouseY < y + rectheight/2)) { - return true; - } else { - return false; - } -} - -void keyPressed() { - if (ismenu) { - } else if (isgame) { - if (key == CODED) { - if (keyCode == UP) { - pos.x = pos.x + 1; - } else if (keyCode == DOWN) { - pos.x = pos.x - 1; - } else if (keyCode == LEFT) { - rotation = rotation +1; - } else if (keyCode == RIGHT) { - rotation = rotation -1; - } - } - } -}