xxxxxxxxxx
var roboto;
//a bis h yKoordinate der Sprossen
var a = 296.9;
var b = 368.8;
var c = 440.7;
var d = 512.6;
var e = 584.5;
var f = 656.4;
var g = 728.3;
var h = 800.2;
var pause = 225;
//Leiter
var l1 = 647;
var l2 = 0;
function preload() {
roboto = loadFont("Roboto-Regular.ttf");
}
function setup() {
createCanvas(493, 800);
background(255);
}
function draw() {
background(255);
//Hintergrund
fill(233,218,199);
rect(0,0,493,800);
//erste rote Linie
stroke(166,54,44);
line(0,60,493,60);
//zweite rote Line
line(0,175,493,175);
//dritte rote Linie
line(0,225,493,225);
//erste Textzeile
fill(166,54,44);
noStroke();
textFont(roboto);
textSize(23);
//textAlign(CENTER,CENTER);
text("a Penguin Book",160,40);
//zweite Textzeile
fill(0);
noStroke();
textFont(roboto);
textSize(38);
//textAlign(CENTER,CENTER);
text("Hurry on Down",200,155);
//dritte Textzeile
fill(166,54,44);
noStroke();
textFont(roboto);
textSize(23);
//textAlign(CENTER,CENTER);
text("John Wain",200,210);
//Sprossen
//a
if (mouseIsPressed){
push();
if (mouseIsPressed){
a = a - 1.3;
if (a < 225) {
a = pause;}}
fill(0);
rect(290,a,140,15);
pop();
//b
push();
if (mouseIsPressed){
b = b - 1.3;
if (b < 225) {
b = pause;}}
fill(0);
rect(290,b,140,15);
pop();
//c
push();
if (mouseIsPressed){
c = c - 1.3;
if (c < 225) {
c = pause;}}
fill(0);
rect(290,c,140,15);
pop();
//d
push();
if (mouseIsPressed){
d = d - 1.3;
if (d < 225) {
d = pause;}}
fill(0);
rect(290,d,140,15);
pop();
//e
push();
if (mouseIsPressed){
e = e - 1.3;
if (e < 225) {
e = pause;}}
fill(0);
rect(290,e,140,15);
pop();
//f
push();
if (mouseIsPressed){
f = f - 1.3;
if (f < 225) {
f = pause;}}
fill(0);
rect(290,f,140,15);
pop();
//g
push();
if (mouseIsPressed){
g = g - 1.3;
if (g < 225) {
g = pause;}}
fill(0);
rect(290,g,140,15);
pop();
//h
push();
if (mouseIsPressed){
h = h - 1.3;
if (h < 225) {
h = pause;}}
fill(0);
rect(290,h,140,15);
pop();
//Leiter
push();
if (mouseIsPressed){
l1 = l1 - 1.3;
if (l1 < 1){
l1 = l2;}}
fill(0);
rect(290,225,15,l1);
rect(415,225,15,l1);
pop();
}
else{
//Standart Animation der Sprossen
//a
a = a - 1.3;
if (a < 225) {
a = 800;}
fill(0);
rect(290,a,140,15);
//b
b = b - 1.3;
if (b < 225) {
b = 800;}
fill(0);
rect(290,b,140,15);
//c
c = c - 1.3;
if (c < 225) {
c = 800;}
fill(0);
rect(290,c,140,15);
//d
d = d - 1.3;
if (d < 225) {
d = 800;}
fill(0);
rect(290,d,140,15);
//e
e = e - 1.3;
if (e < 225) {
e = 800;}
fill(0);
rect(290,e,140,15);
//f
f = f - 1.3;
if (f < 225) {
f = 800;}
fill(0);
rect(290,f,140,15);
//g
g = g - 1.3;
if (g < 225) {
g = 800;}
fill(0);
rect(290,g,140,15);
//h
h = h - 1.3;
if (h < 225) {
h = 800;}
fill(0);
rect(290,h,140,15);
pop();
fill(0);
noStroke();
rect(290,225,15,l1);
rect(415,225,15,l1);
if (mouseIsPressed) {
if (l1 == 647) {
l1 = 647}
else {
l1 = 647;}
}
}
}