jeudi 30 mai 2019

How do I generate a predictable random stream in heirachy in c#?

I am making a procedural game with heirachy.

So object A will have 10 children. Each child will have 10 children and so on.

Now suppose I want to give each child a random colour, and a random position (assume these are given by integers).

Therefor let X be the "ID" of an object. Let COLOUR and POSITION be enums of type PROPERTY.

Then I want to generate random integers:

int GenerateRandomInteger(PROPERTY P, int childNumber);

So I can use:

int N = parentObject.GenerateRandomInteger(COLOUR, 7);

for example.

Any ideas how to go about this?




Aucun commentaire:

Enregistrer un commentaire