Check this circuit:
Here you have a PNP transistor, that has 0,7V between emiter and base.
D1 is a diode, that could be a LED diode, with 1,7V diode tension.
Then, the value of current in collector-emiter from circuit, will be:
Ice = (Vdiode - Vbe) / Rlimit
So, for 500mA => Rlimit = (1.7-0.7) / 0.5 A = 1/0.5 = 2ohm.
The current in Rload will be always 500mA, and regulated!!!
Chose a transistor that supports more than 1A in collector-emiter, for not burning.
Hope it helps.
Good luck