mercredi 20 décembre 2017

How to set a percentage chance to make something

I making a fighting game. Its like there are two players. They have 100 hp and they choose attack value btween 0-100 when they're fighting. After they choose value they should have %(100-value) chance of being successful with this attack. For example if they choose value 60, they have %40 chance to be successful with this attack. I see people doing this kind of things with random module but i could not understand how random module works. Can you please help. Sorry for bad english.




Aucun commentaire:

Enregistrer un commentaire