Getting a seeded value from a list

frednotbob at hotmail.ca frednotbob at hotmail.ca
Tue Nov 20 21:18:17 EST 2012


>
>The former can be generated from the seed each 
>time you enter the level; the latter must be generated the first time then 
>stored. 
>

Random.random() is already populating the levelSeed list; I've set it as part of new_game() so that any time the player begins a new game, the levelSeed list is replenished with a new set of data.

The problem, in a nutshell, is this:

When the player starts a new game, make_map() randomly generates level 'Foo' as the player's starting floor.  Floor 'Bar' is similarly generated as the player descends from 'Foo' to 'Bar.  

Each time the player goes from 'Foo' to 'Bar' (or vice versa), make_map randomly generates a new layout for either level.

What I'd like to do is select values from 'levelSeed' and assign them to the levels that make_map generates so that the player goes back to the same 'Foo' and 'Bar' each time (at least until the player repopulates levelSeed with new values by whatever method I eventually decide to use).

I simply can't find any relevant examples online; everything I've found so far is either intended for a different purpose or assumes that the reader is already an experienced programmer.



More information about the Python-list mailing list