Use a global variable var_gold to store gold.
Have a sprite for your gold coins to collect.
Player on collision with goldsprite
- Add 1 to var_gold
- Destroy goldsprite
Set up a trigger that happens whenever your player double jumps. Maybe something like:
Player is jumping
On jump key pressed
On your double jump trigger
- Subtract 1 from var_gold