public void run(){
       double time = 0.5;
       while(!TheGame.isOver){
           double accelerationX=0,accelerationY=0;
           if(TheGame.isRun){
        for(Rectangle f: Rectangle.moveList){
            if (f.isIn(this.getX(),this.getY())){
                accelerationX +=f.getAccelerationX(this);
                accelerationY +=f.getAccelerationY(this);
                f.haveDone = true;
            }
        }
        double tempY =y;
        y=(2*y-recY+(accelerationY*time*time)/10);
        recY=tempY;

        double tempX = x;
        x=(2*x-recX+(accelerationX*time*time)/10);
        recX=tempX;

        try {
            Thread.currentThread().sleep(Math.round(10 * time));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
            GameFrame.gameArea.repaint();

    }else {}
    }
        if (TheGame.win){
            new WinFrame(this);
            Thread.currentThread().interrupt();
        }else {
            new GameOverFrame(this);
            Thread.currentThread().interrupt();

    }
    }