Would I need to store the folder it selected somehow, so it remembers the choice? Then have some very basic if/elif/else stuff so that I can have it give points based off of correct answer, then display the next image, etc.? I'm not good at this non beginner friendly ren'py stuff, and this is the conclusion I came to based off of this thread.
edit: small brain is small and ended up just defining two different random image things, a showRandomImageA and a showRandomImageB, then decided to use renpy.random.randint(0,1) and have it jump to showRandomImageA if it's a 0, B if it's a 1. Which works, but I'm derping somewhere because if I have it do a show expression showRandomImageA/B, it won't hide the image after jumping to a different label, and using hide seems to fail me. Renpy docs say it should clear with a jump, but they don't.
edit 2: small pea brain has found that I can clear images using scene black or $ renpy.scene(). Now I just need to figure out a point system, etc. I'm sure all of this could have been done in a really easy way, but here's the vomit of code I have. Ignore the testing bits at the bottom, but yeah.
Python:
init python:
def showRandomAImage(subdir="."):
directory = "/".join([config.gamedir.replace("\\", "/"), "accepted", subdir])
modImageList = [ "/".join([directory, filename])
for filename in renpy.os.listdir(directory)
if filename.endswith((".webp", ".png", ".jpg")) ]
selectedImage = renpy.random.choice(modImageList)
renpy.show("randimg", what=Image( selectedImage ) )
return selectedImage
def showRandomRImage(subdir="."):
directory = "/".join([config.gamedir.replace("\\", "/"), "rejected", subdir])
modImageList = [ "/".join([directory, filename])
for filename in renpy.os.listdir(directory)
if filename.endswith((".webp", ".png", ".jpg")) ]
selectedImage = renpy.random.choice(modImageList)
renpy.show("randimg", what=Image( selectedImage ) )
return selectedImage
label randimgtest2:
$ randgamenbr = renpy.random.randint(0,1)
if (randgamenbr == 0):
jump randimgaccept
elif (randgamenbr == 1):
jump randimgreject
label randimgaccept:
show expression showRandomAImage()
"1"
pause
"clearing."
scene black
jump start
label randimgreject:
show expression showRandomRImage()
"2"
pause
"clearing."
scene black
jump start