For my game I have planned to have for each new game start a different gameplay.
So how to achieve that:
All of my game objects have a unique ID which are stored in a class with its position and rotation.
So I will add more to the class.
So know comes my random selection:
def createIds(all_ID): for i in range(0, 101): all_ID.append(i) #print (all_ID, 'all_ID') else: pass return all_ID if Sens.positive: all_IDs = createIds(all_ID) randomObjIds = random.sample(all_IDs, 20) # Choose 20 elements print (randomObjIds)
So I will add only the object which are in the randomObjIds list.
What do you think? Would that be a good idea to do it this way or do you have a better idea?
Thanks in advance