float ySpeed = 0; float y1Speed = 0; boolean numberHere = true; boolean numberisHere = true; float y = -15; float y1 = 100; void setup() { size(500, 450); frameRate(30); background(0); tint(255,0,0); PImage ba; ba = loadImage("car.png"); image(ba, 350, 90, 100, 170); tint(0); PImage b1; b1 = loadImage("lines.png"); image(b1, 350, 30, 100, 80); PImage b2; b2 = loadImage("down_arrow.png"); image(b2, 375, 255, 50, 50); tint(255,0,0); PImage c; c = loadImage("car2.png"); image(c, 50, 90, 100, 170); PImage g; g = loadImage("numbers.png"); image(g, 0, y, 60, 280); image(g, 440, y1, 60, 280); PImage g1; g1 = loadImage("dial.png"); image(g1, 5, -87, 60, 550); image(g1, 450, -87, 60, 550); tint(0); PImage c1; c1 = loadImage("upArrow.png"); image(c1, 75, 43, 50, 50); PImage c2; c2 = loadImage("lines_up.png"); image(c2, 50, 255, 100, 80); tint(255); PImage e; e = loadImage("level5.png"); image(e, 180, 10, 150, 40); PImage f; f = loadImage("downButton.png"); image(f, 212, 200, 80, 80); } void draw(){ //background(0); fill(0); noStroke(); rect(450, 0, 50, 450); PImage g3; tint(255,0,0); g3 = loadImage("numbers.png"); image(g3, 440, y1, 60, 280); y1+=y1Speed; if(mousePressed==true && mouseX>212 && mouseX<292 && mouseY>200 && mouseY<280 && numberHere== true){ // y1Speed = 1; tint(0,255,0); PImage b; b = loadImage("car.png"); image(b, 350, 90, 100, 170); PImage b1; b1 = loadImage("lines.png"); image(b1, 350, 30, 100, 80); PImage b2; b2 = loadImage("down_arrow.png"); image(b2, 375, 255, 50, 50); y1Speed = -1; tint(0,255,0); g3 = loadImage("numbers.png"); image(g3, 440, y1, 60, 280); } if(mousePressed==false && numberHere== true && y1 == 40){ numberHere = false; tint(0,255,0); g3 = loadImage("numbers.png"); image(g3, 440, y1, 60, 280); y1Speed = 0; } tint(255); if(mousePressed==true && mouseX>212 && mouseX<292 && mouseY>200 && mouseY<280){ for (int i=145; i>50; i--) // glow behind the down button/ gradient { noStroke(); fill (145-i,145-i,0); ellipse(254, 241, i-33, i-33); } } PImage f; f = loadImage("downButton.png"); image(f, 212, 200, 80, 80); fill(0); noStroke(); rect(0, 0, 50, 450); PImage g4; tint(255,0,0); g4 = loadImage("numbers.png"); image(g4, 0, y, 60, 280); y+=ySpeed; if(mousePressed==true && mouseX>215 && mouseX<293 && mouseY>90 && mouseY<168 && numberisHere == true){ ySpeed = 1; tint(0,255,0); PImage c; c = loadImage("car2.png"); image(c, 50, 90, 100, 170); PImage c2; c2 = loadImage("lines_up.png"); image(c2, 50, 255, 100, 80); PImage c1; c1 = loadImage("upArrow.png"); image(c1, 75, 43, 50, 50); tint(0,255,0); g4 = loadImage("numbers.png"); image(g4, 0, y, 60, 280); } if(mousePressed==false && numberisHere== true && y == 43){ numberisHere = false; tint(0,255,0); g4 = loadImage("numbers.png"); image(g4, 440, y, 60, 280); ySpeed = 0; } PImage g5; g5 = loadImage("dial.png"); image(g5, 5, -87, 60, 550); PImage g1; g1 = loadImage("dial.png"); image(g1, 450, -87, 60, 550); tint(255); if(mousePressed==true && mouseX>215 && mouseX<293 && mouseY>90 && mouseY<168){ for (int i=145; i>50; i--) // glow behind the up button/ gradient { noStroke(); fill (145-i,145-i,0); ellipse(254, 128, i-33, i-33); } } PImage g; g = loadImage("upButton.png"); image(g, 215, 90, 78, 78); }