jeudi 19 avril 2018

Generating a random number, each time I access a specific slot of a list

Good day to everyone,

Here's my list :

E=[[["Bandit"],["Wolf"]],[[randint(10,15)],[randint(5,10)]],[[["Sharp blade"],["Punch"]],[["Bite"],["Howling"]]],[[[15],[10]],[[5],[1]]]] #List of Ennemies of the zone :NAME-HP-ATTACKS NAME-ATTACKS DAMMAGE

The thing is, it's a list for a game, that needs to be accessed each time, I need new HP for my generating ennemies. However and I understand why, the moment I compile, the HP has been set in stones. If I want new HP levels, I will have to recompile to call the rand function.

Is there anyway, to generate in that specific slot (E[1]), new HP each time I call the list without recompiling ? It would add some diversity to the battles.




Aucun commentaire:

Enregistrer un commentaire