@Override
    public void keyPressed(KeyEvent e) {
        
        if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
            if (heroCurrentX < 450) {
                heroCurrentX += 4;
            } else {
                heroCurrentX += 0;
            }
        } else {
            if (e.getKeyCode() == KeyEvent.VK_LEFT) {
                if (heroCurrentX > 0) {
                    heroCurrentX -= 4;
                } else {
                    heroCurrentX += 0;
                }
            } else {
                if (e.getKeyCode() == KeyEvent.VK_UP) {
                    if (heroCurrentY > 0) {
                        heroCurrentY -= 4;
                    } else {
                        heroCurrentY += 0;
                    }
                } else {
                    if (e.getKeyCode() == KeyEvent.VK_DOWN) {
                        if (heroCurrentY < 350) {
                            heroCurrentY += 4;
                        } else {
                            heroCurrentY += 0;
                        }
                    }
                }
            }
        }


        checkCollisions(heroCurrentX, heroCurrentY);
        pickedUpCoin(heroCurrentX, heroCurrentY);
        repaint();

    }