@Override
    public void keyPressed(KeyEvent e) {

        switch (e.getKeyCode()) {

            //Move up
            case KeyEvent.VK_UP:
            case KeyEvent.VK_W:
                yoshi.location.y -= 10;
                repaint();
                break;

            // Move Left
            case KeyEvent.VK_LEFT:
            case KeyEvent.VK_A:
                yoshi.location.x -= 10;
                repaint();
                break;

            // Move Right    
            case KeyEvent.VK_RIGHT:
            case KeyEvent.VK_D:
                yoshi.location.x += 10;
                repaint();
                break;

            // Move Down
            case KeyEvent.VK_DOWN:
            case KeyEvent.VK_S:
                yoshi.location.y += 10;
                repaint();
                break;
        }

    }