hey,
i want that counter is saved when somebody restart the app or something.
I tried it with a string but idk how i can do it. I think you dont need the pictures.
thanks for help
here the code:
PImage yo_oli, kind, aldi, shop_innen;
int x;
int counter,level, auswahl;
void setup()
{
size(displayWidth, displayHeight);
orientation(LANDSCAPE);
yo_oli=loadImage("yo_oli2.png");
kind=loadImage("kind.png");
aldi=loadImage("aldi.jpg");
shop_innen=loadImage("shop.jpg");
x=400;
level=1;
auswahl=1;
}
void draw()
{
if (auswahl==1)
{
image(aldi, 0, 0, displayWidth, displayHeight);
image(yo_oli, x, 200, 400, 800);
image(kind, 1000, 140, 300, 400);
fill(255, 64, 64);
rect(750, 700, 400, 200);
rect(1600, 900, 300, 100);
fill(139, 0, 0);
textSize(50);
text("Rein in die Olga", 760, 810);
text("Olga Counter:" + counter, 720, 50);
text("Level: " + level, 20, 50);
text("Shop", 1690, 970);
if (x>600)
{
x=400;
counter=counter+1;
}
//LEVEL
if (counter>20)
{
level=2;
}
if (counter>40)
{
level=3;
}
if (counter>60)
{
level=4;
}
if (counter>80)
{
level=5;
}
if (counter>100)
{
level=6;
}
if (counter>120)
{
level=7;
}
if (counter>140)
{
level=8;
}
if (counter>160)
{
level=9;
}
}
if (auswahl==2)
{
image(shop_innen, 0, 0, displayWidth, displayHeight);
fill(255, 64, 64);
rect(10, 900, 300, 100);
fill(139, 0, 0);
textSize(50);
text("back", 100, 970);
textSize(100);
text("Coming soon!", 600, 500);
}
}
void mousePressed()
{
println(mouseX, mouseY);
if (auswahl==1)
{
if (mouseX>750 && mouseX<1150 && mouseY>700 && mouseY<900)
{
x=x+100;
}
if (mouseX>1600 && mouseX<1900 && mouseY>900 && mouseY<1000)
{
auswahl=2;
}
}
if (auswahl==2)
{
if (mouseX>10 && mouseX<310 && mouseY>900 && mouseY<1000)
{
auswahl=1;
}
}
}