- Home /
Question by
ThePolarGriz · Nov 29, 2017 at 08:01 PM ·
gunspacehudspace shooterammo
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
Comment
Answer by mafima · Nov 29, 2017 at 08:35 PM
public int ammo=10;
public void shoot(){
ammo--;
}
public void increaseammo(int num){
ammo+=num;
}
write a class with this.
call the shoot method when you shoot
call the increaseammo when an asteroid dies
you didnt provide anything so, i need to be general here
Your answer
Follow this Question
Related Questions
Ammo GUI Help 2 Answers
Hud on Weapon 1 Answer
Gun script not working 3 Answers
gui help for ammo display 1 Answer
FPS UI ammo display problem 0 Answers