mercredi 18 octobre 2017

Generate random values based on a seed Swift 3

lets say you were making a game and this game has procedurally generated terrain from a seed that the user inputted in his world-creation menu

and this seed generates a set of values that only change if the seed changes

for instance lets say i want get 3 values of anywhere in between 1-9 and i put the seed in "230" and it gives me the three values of "1-2-8" and then i change the seed to "241" and the values change to "1-3-8" but then i change the seed back to "230" and the values change to "1-2-8"

how would one achieve that in swift




Aucun commentaire:

Enregistrer un commentaire