@Override
    public void handle(KeyEvent event) {
        final KeyCode keyCode = event.getCode();
        switch(keyCode) {
            case UP:
                if(moveDirection != Direction.DOWN)
                    nextMoveDirection = Direction.UP;       
                break;
            case DOWN:  
                if(moveDirection != Direction.UP)
                    nextMoveDirection = Direction.DOWN;     
                break;
            case LEFT:  
                if(moveDirection != Direction.RIGHT)
                    nextMoveDirection = Direction.LEFT;     
                break;
            case RIGHT: 
                if(moveDirection != Direction.LEFT)
                    nextMoveDirection = Direction.RIGHT;    
                break;
        }
    }