Hi!
I have a small update, but unfortunately the project is still unsuccessful at the moment. I found
I think this is closer to what I am looking for, however, when I tried to do something similar, I get an ‘invalid operation’ error. Here is my current code:
im = random.choice(imList)
nIms = random.randint(3, 7)
# positions
pos1 = [-750, 0]
pos2 = [-650, 0]
pos3 = [-550, 0]
pos4 = [-450, 0]
pos5 = [-350, 0]
pos6 = [-250, 0]
pos7 = [-150, 0]
if nIms == 3:
for pos in [pos1, pos2, pos3]:
im.pos = pos
elif nIms == 4:
for pos in [pos1, pos2, pos3, pos4]:
im.pos = pos
elif nIms == 5:
for pos in [pos1, pos2, pos3, pos4, pos5]:
im.pos = pos
elif nIms == 6:
for pos in [pos1, pos2, pos3, pos4, pos5, pos6]:
im.pos = pos
elif nIms == 7:
for pos in [pos1, pos2, pos3, pos4, pos5, pos6, pos7]:
im.pos = pos
im.draw(); win.flip(); core.wait(1)
As a reminder, im is a variable that randomly selected a hard coded image from a list. The images on that list have no assigned position yet. I hope to display a random image a random number of times in different coded positions across the screen. I think the forum linked in this update is close to what I want to do, but if anyone spots anything off with my code, please let me know!
Thank you!