@Override
    public void run() {
        addMouseListener(this);
        reset();
        while (true) {
            BufferStrategy bufferStrategy = getBufferStrategy();
            try {
                if (bufferStrategy == null) {
                    createBufferStrategy(2);
                } else {
                    Graphics2D graphics2D = (Graphics2D) bufferStrategy.getDrawGraphics();
                    render(graphics2D);
                    bufferStrategy.show();
                    Thread.sleep(10);
                }
            } catch (Exception e) {
                //e.printStackTrace();
                //TODO
            }
        }
    }