Ammo Counting,

i need some help im trying to make a version of the space shooter tutorial where you have an ammo amount displayed on the screen that decreases when you shoot but increases when you destroy an asteroid

public int ammo=10;

public void shoot(){

public void increaseammo(int num){
  1. write a class with this.
  2. call the shoot method when you shoot
  3. call the increaseammo when an asteroid dies

you didnt provide anything so, i need to be general here