public static void main(String[] args) {
        {
               room();
               double x=0.35;
               double y=.051;
               player(x,y);
               double x_neu;
               double y_neu;
               double i=0.5;
               double j=0.5;
               double k=0.7;
               double l=0.2;
               double n=0.1;
               double m=0.82;
               Falle1(i,j);
               Falle2(k,l);
               double i_neu;
               double j_neu;
               double k_neu;
               double l_neu;
               double n_neu;
               double m_neu;
               int p_1 =1;
               int p_2 =1;
               int p_3 =1;
                while (x>=0.001 && x<=1 )
                {	
                	StdDraw.show(0);
                    StdDraw.setPenRadius(.06);
                    StdDraw.setPenColor(Color.WHITE);
                    StdDraw.filledSquare(i, j, 0.02);
                    StdDraw.filledSquare(k, l, 0.02);
                    StdDraw.filledSquare(n, m, 0.02);
                	if(i<0.97 && j<0.97 && p_1==1){
                		i_neu=i+0.001;
                		j_neu=j+0.001;
                		i=i_neu;
                		j=j_neu;
                		}
                	else if((i>0.03 || j>0.03) &&p_1==0) {                	
                		i_neu=i-0.001;
                		j_neu=j-0.001;
                		i=i_neu;
                		j=j_neu;
                		}
                	else {
                		if (p_1==1){
                			p_1=0;}
                		else {
                			p_1=1;}
                			}
                	Falle1(i,j);
                	if(k<0.96 && l<0.97 && p_2==1){
                		k_neu=k+0.001;
                		l_neu=l+0.001;
                		k=k_neu;
                		l=l_neu;
                		}
                	else if(k<0.97 && l<0.97 && p_2==2){
                			k_neu=k-0.001;
                			l_neu=l+0.001;
                			k=k_neu;
                			l=l_neu;
                		}
                	else if(k>0.03 && l>0.03 &&p_2==3) {                	
                		k_neu=k-0.001;
                		l_neu=l-0.001;
                		k=k_neu;
                		l=l_neu;
                		}
                	else if(k>0.02 && l>0.03 &&p_2==0) {                	
                		k_neu=k+0.001;
                		l_neu=l-0.001;
                		k=k_neu;
                		l=l_neu;
                		}
                	else {
                		if (p_2==1){
                			p_2=2;}
                		else if(p_2==2) {
                			p_2=3;}
                		else if (p_2==3){
                			p_2=0;}
                		else{
                			p_2=1;}
                		}
                	Falle2(k,l); 
                	if(n<0.97 && m<0.97 && p_3==1){
                		n_neu=n+0.001;
                		m_neu=3*n_neu*n_neu-3*n_neu+1;
                		n=n_neu;
                		m=m_neu;
                		}
                	else if(n>0.03 && m>0.03 &&p_3==0) {                	
                		n_neu=n-0.001;
                		m_neu=3*n_neu*n_neu-3*n_neu+1;
                		n=n_neu;
                		m=m_neu;
                		}
                	else {
                		if (p_3==1){
                			p_3=0;}
                		else {
                			p_3=1;}
                			}
                	Falle3(n,m); 
                		StdDraw.setPenRadius(.06);
                		StdDraw.setPenColor(Color.WHITE);
                        if (StdDraw.isKeyPressed(KeyEvent.VK_LEFT)) 
                        {
                                x_neu = x-0.001;
                                y_neu=y;
                                if (x_neu <= 0.05 || y_neu>=0.95){ 
                                	x_neu=x;			}
                                else
                                {
                                StdDraw.point(x, y);
                                x=x_neu;
                                y=y_neu;
                                player(x,y);
                                }
                        }
                        else if (StdDraw.isKeyPressed(KeyEvent.VK_RIGHT)) 
                        {
                                x_neu = x+0.001;
                                y_neu = y;
                                if (x_neu >= 0.95|| y_neu>=0.95) 
                                { x_neu=x; 
                                } 
                                else{
                                StdDraw.point(x, y);
                                x=x_neu;
                                y=y_neu;
                                player(x,y);
                              }
                        }
                        else if (StdDraw.isKeyPressed(KeyEvent.VK_UP)) 
                        {	
                                x_neu = x;
                                y_neu = y+0.001;
                                if (y_neu>=0.95) 
                                {	
                                	if(x_neu> 0.3 && x_neu< 0.4 &&y_neu<=0.05|| x_neu>0.7 && x_neu< 0.8){
                                		StdDraw.point(x, y);
                                        x=x_neu;
                                        y=y_neu;
                                        player(x,y);
                                }
                                else{
                                        y_neu=y;}
                                } 
                                else{
                                StdDraw.point(x, y);
                                x=x_neu;
                                y=y_neu;
                                player(x,y);
                                }
                        }
                        else if (StdDraw.isKeyPressed(KeyEvent.VK_DOWN)) 
                        {	
                                x_neu = x;
                                y_neu = y-0.001;
                                if (y_neu<=0.05||y_neu>=0.95) 
                                {
                                        y_neu=y;
                                } else{
                                StdDraw.point(x, y);
                                x=x_neu;
                                y=y_neu;
                                player(x,y);
                                }
                        }
                        if ((x<=i+0.04 && x>=i-0.04 && y<=j+0.04 && y>=j-0.04)|| x<=k+0.04 && x>=k-0.04 && y<=l+0.04 && y>=l-0.04 || x<=n+0.04 && x>=n-0.04 && y<=m+0.04 && y>=m-0.04)
                        {
                    	   	StdDraw.clear();
                            Menue.main(args);
                                break;
                        }
                        if (y>1)
                        {
                     	  Level3.main(args);
                     	  break;
                        }
                }
        }
}

public static void main(String[] args) {
        {
               room();
               double x=0.35;
               double y=.051;
               player(x,y);
               double x_neu;
               double y_neu;
               double i=0.5;
               double j=0.5;
               double k=0.7;
               double l=0.2;
               double n=0.1;
               double m=0.82;
               Falle1(i,j);
               Falle2(k,l);
               double i_neu;
               double j_neu;
               double k_neu;
               double l_neu;
               double n_neu;
               double m_neu;
               int p_1 =1;
               int p_2 =1;
               int p_3 =1;
                while (x>=0.001 && x<=1 )
                {	
                	StdDraw.show(1);
                    StdDraw.setPenRadius(.06);
                    StdDraw.setPenColor(Color.WHITE);
                    StdDraw.filledSquare(i, j, 0.02);
                    StdDraw.filledSquare(k, l, 0.02);
                    StdDraw.filledSquare(n, m, 0.02);
                	if(i<0.97 && j<0.97 && p_1==1){
                		i_neu=i+0.001;
                		j_neu=j+0.001;
                		i=i_neu;
                		j=j_neu;
                		}
                	else if((i>0.03 || j>0.03) &&p_1==0) {                	
                		i_neu=i-0.001;
                		j_neu=j-0.001;
                		i=i_neu;
                		j=j_neu;
                		}
                	else {
                		if (p_1==1){
                			p_1=0;}
                		else {
                			p_1=1;}
                			}
                	Falle1(i,j);
                	if(k<0.96 && l<0.97 && p_2==1){
                		k_neu=k+0.001;
                		l_neu=l+0.001;
                		k=k_neu;
                		l=l_neu;
                		}
                	else if(k<0.97 && l<0.97 && p_2==2){
                			k_neu=k-0.001;
                			l_neu=l+0.001;
                			k=k_neu;
                			l=l_neu;
                		}
                	else if(k>0.03 && l>0.03 &&p_2==3) {                	
                		k_neu=k-0.001;
                		l_neu=l-0.001;
                		k=k_neu;
                		l=l_neu;
                		}
                	else if(k>0.02 && l>0.03 &&p_2==0) {                	
                		k_neu=k+0.001;
                		l_neu=l-0.001;
                		k=k_neu;
                		l=l_neu;
                		}
                	else {
                		if (p_2==1){
                			p_2=2;}
                		else if(p_2==2) {
                			p_2=3;}
                		else if (p_2==3){
                			p_2=0;}
                		else{
                			p_2=1;}
                		}
                	Falle2(k,l); 
                	if(n<0.97 && m<0.97 && p_3==1){
                		n_neu=n+0.001;
                		m_neu=3*n_neu*n_neu-3*n_neu+1;
                		n=n_neu;
                		m=m_neu;
                		}
                	else if(n>0.03 && m>0.03 &&p_3==0) {                	
                		n_neu=n-0.001;
                		m_neu=3*n_neu*n_neu-3*n_neu+1;
                		n=n_neu;
                		m=m_neu;
                		}
                	else {
                		if (p_3==1){
                			p_3=0;}
                		else {
                			p_3=1;}
                			}
                	Falle3(n,m); 
                		StdDraw.setPenRadius(.06);
                		StdDraw.setPenColor(Color.WHITE);
                        if (StdDraw.isKeyPressed(KeyEvent.VK_LEFT)) 
                        {
                                x_neu = x-0.001;
                                y_neu=y;
                                if (x_neu <= 0.05 || y_neu>=0.95){ 
                                	x_neu=x;			}
                                else
                                {
                                StdDraw.point(x, y);
                                x=x_neu;
                                y=y_neu;
                                player(x,y);
                                }
                        }
                        else if (StdDraw.isKeyPressed(KeyEvent.VK_RIGHT)) 
                        {
                                x_neu = x+0.001;
                                y_neu = y;
                                if (x_neu >= 0.95|| y_neu>=0.95) 
                                { x_neu=x; 
                                } 
                                else{
                                StdDraw.point(x, y);
                                x=x_neu;
                                y=y_neu;
                                player(x,y);
                              }
                        }
                        else if (StdDraw.isKeyPressed(KeyEvent.VK_UP)) 
                        {	
                                x_neu = x;
                                y_neu = y+0.001;
                                if (y_neu>=0.95) 
                                {	
                                	if(x_neu> 0.3 && x_neu< 0.4 &&y_neu<=0.05|| x_neu>0.7 && x_neu< 0.8){
                                		StdDraw.point(x, y);
                                        x=x_neu;
                                        y=y_neu;
                                        player(x,y);
                                }
                                else{
                                        y_neu=y;}
                                } 
                                else{
                                StdDraw.point(x, y);
                                x=x_neu;
                                y=y_neu;
                                player(x,y);
                                }
                        }
                        else if (StdDraw.isKeyPressed(KeyEvent.VK_DOWN)) 
                        {	
                                x_neu = x;
                                y_neu = y-0.001;
                                if (y_neu<=0.05||y_neu>=0.95) 
                                {
                                        y_neu=y;
                                } else{
                                StdDraw.point(x, y);
                                x=x_neu;
                                y=y_neu;
                                player(x,y);
                                }
                        }
                        if ((x<=i+0.04 && x>=i-0.04 && y<=j+0.04 && y>=j-0.04)|| x<=k+0.04 && x>=k-0.04 && y<=l+0.04 && y>=l-0.04 || x<=n+0.04 && x>=n-0.04 && y<=m+0.04 && y>=m-0.04)
                        {
                    	   	StdDraw.clear();
                            Menue.main(args);
                                break;
                        }
                        if (y>1)
                        {
                     	  Level3.main(args);
                     	  break;
                        }
                }
        }
}
