int w; int h;
int fullFrame=40; PFont standartFont;
PImage gear1, logo1, ball1, shyriken1;
PShape gear2;
int score=335527890; String scoreAll="score "+score; String []scoreres=new String[20];
int gameStatus=1, menuStatus=1; int status=0; int prs=0;
float bgR=220, bgG=80, bgB=20, bgE=10, bgTurn=1;
float flx1, fly1, flx2, fly2;
int x1, y1, x2, y2, x3, y3, x4, y4, x5, y5;
int var1, var2, var3, var4, var5, var6, var7;
void setup(){
fullScreen(P2D); imageMode(CENTER); textureMode(NORMAL); frameRate(fullFrame); noStroke(); textAlign(CENTER);
background(bgR,bgG,bgB);
w=width; h=height;
String[] scoreres=loadStrings("scoreres.txt");
standartFont=loadFont("standart.vlw"); textFont(standartFont);
}
void draw(){
if(gameStatus==1){menu();}
if(gameStatus==2){main();}
} //void draw
void main(){} //void main
void gameplay(){} //void gameplay
void controlPrs(int xc,int yc,int ww,int hh,int method,int x1,int y1,int x2,int y2,int x3,int y3,int x4,int y4){
if(method==1){
if(mousePressed==true&&mouseX>xc-ww/2&&mouseX<xc+ww/2&&mouseY>yc-hh/2&&mouseY<yc+hh/2){mousePressed=false; prs=1;}else{prs=0;}}
if(method==2){
}
} //void controlPrs
void menu(){
background(bgR,bgG,bgB);
bgR=220+bgE; bgG=80+bgE; bgB=40+bgE;
if(bgTurn==1){bgE+=0.5;}else{bgE-=0.5;}
if(bgE<-20){bgTurn=1;} if(bgE>20){bgTurn=0;}
if(var1==0){
controlImage(1);
controlShape(1,600,600);
var1=1;}
shape(gear2,w-300,h-300);
gear2.translate(-300,-300);
gear2.rotate(radians(1));
gear2.translate(300,300);
if(menuStatus==1&&status==0){
controlImage(2);
image(logo1,w/2,h/2,w/5*3,w/5*3);
controlText("*press*",40, w/2,h/6*4);
if(mousePressed){
mousePressed=false;
menuStatus=2;
var2=0;
flx1=w/2; fly1=h/2;
x1=w+w/7*2; y1=h/10*4;
x2=w+w/6*2; y2=h/10*5;
x3=w+w/5*2; y3=h/10*6;
x4=w+w/4*2; y4=h/10*7;
x5=w/2+10; y5=h+h/2;
}}
if(menuStatus==2&&status==0){
image(logo1,flx1,fly1,w/5*3,w/5*3);
if(var2==0){fly1-=8;}else{fly1-=bgE/15;} if(fly1<h/5){var2=1;}
controlText("PLAY",80,x1,y1);
if(var3==0){x1-=8;} if(x1<w/2+10){var3=1;}
controlText(scoreres[7],75,x2,y2);
if(var4==0){x2-=8;} if(x2<w/2+10){var4=1;}
controlText("ACHIEVEMENT",75,x3,y3);
if(var5==0){x3-=8;} if(x3<w/2+10){var5=1;}
controlText("INFO",75,x4,y4);
if(var6==0){x4-=8;} if(x4<w/2+10){var6=1;}
controlText("out",65,x5,y5);
if(var7==0){y5-=8;} if(y5<h/10*9){var7=1;}
if(var2>0&&var7>0){menuStatus=3; var2=var3=var4=var5=var6=var7=0;}}
if(menuStatus==3&&status==0){
image(logo1,flx1,fly1,w/5*3,w/5*3); fly1-=bgE/15;
controlText("PLAY",80,x1,y1);
controlPrs(x1,y1,w/3*2,h/7,1,0,0,0,0,0,0,0,0);
if(prs==1){menuStatus=0; status=0; gameStatus=2;}
controlText(scoreAll,75,x2,y2);
controlText("ACHIEVEMENT",75,x3,y3);
controlText("INFO",75,x4,y4);
controlText("out",65,x5,y5);
controlPrs(x5,y5,w/3*2,h/7,1,0,0,0,0,0,0,0,0);
if(prs==1){
System.exit(0);}}
} //void menu
void controlText(String text, int size, int x, int y){
textSize(size);
fill(1,1,1);
text(""+text+"",x,y);
noFill();
} //void text
void controlImage(int num){
if(num==1){
gear1=loadImage("gear.png");}else{gear1=null;}
if(num==2){
logo1=loadImage("logo.png");}else{logo1=null;}
if(num==3){
ball1=loadImage("logo.png");}else{ball1=null;}
if(num==4){
shyriken1=loadImage("logo.png");}else{shyriken1=null;}
} //controlImage
void controlShape(int num, int shapeX, int shapeY){
if(num==1){
gear2=createShape(); gear2.beginShape(); gear2.texture(gear1);
gear2.vertex(0,0,0,0);
gear2.vertex(shapeX,0,1,0);
gear2.vertex(shapeX,shapeY,1,1);
gear2.vertex(0,shapeY,0,1);
gear2.endShape();}else{gear2=null;}
} //controlShape