@Override
    public void keyPressed(KeyEvent e) {
        switch (e.getKeyCode()) {
            case KeyEvent.VK_UP:
                direction = Direction.N;
                break;
            case KeyEvent.VK_DOWN:
                direction = Direction.S;
                break;
            case KeyEvent.VK_LEFT:
                direction = Direction.W;
                break;
            case KeyEvent.VK_RIGHT:
                direction = Direction.E;
                break;
        }
        if (e.getKeyCode() == KeyEvent.VK_ENTER && lost) {
            lost = false;
            reset();
        }
    }