Is there a way to keep track of Accuracy in a shmup?
I'm making a Shoot 'em Up game, and I'd like to display the players accuracy percentage based on shots fired/enemies hit and display it on my game over/ retry screen. Is there a way to do this with GS?
thanks!
thanks!
Comments
Making 2 integer attributes, 1 called ShotsFired, and the other called TargetsHit. As well as 1 index attribute called Accuracy.
-Every time a shot is fired, change attribute ShotsFired to ShotsFired + 1.
-Every time a shot is fired and the bullet hits a target (enemy), change attribute TargetsHit to TargetsHit + 1.
Then in the game over scene in your actor that displays the accuracy, change attribute Accuracy to TargetsHit/ShotsFired. ( / = divided by )
This will give you a # between 1.00 and 0.00, 1 obviously being 100% and 0 being 0%. You can then multiply this by 100, so it gives you a number between 0 and 100.
Make sure to change all 3 attributes to 0 when leaving the game over scene so that the accuracy can be counted again next time the game is played.
Hope this helps!
you're a genius!
for anyone else doing this, your Display Text behavior should read:
Text: game.Accuracy.."%" so it displays as a percentage instead of just a whole number