Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
I'm trying to make a rock-paper-scissors mini game and I'm...kind of stuck. I would like to show an image that is associated with the random choice results, but I can't seem to get it to work? (I took out papers and scissors in my code because I wanted to test if I could get the rock picture to show up...but alas, I cannot). Am I doing everything wrong? I'm still a beginner at renpy and would like some help.
define hands = ["rock"]
image rock = "images/rock.png"
init python:
r = renpy.random.choice
label start:
"going to choose..."
$ result = r(hands) #THIS WILL ALWAYS BE ROCK
"[result]"
if result == "rock":
show rock
else:
pass
return
Last edited by needchocolatenow on Thu Oct 19, 2017 10:49 pm, edited 1 time in total.
When are you expecting the rock image to appear? As the code you gave runs, the image will show, but immediately be removed by the "return" command as the game returns to the main menu. Thus, the rock image is gone before the player sees it. are you sure the image wasn't meant to be shown before the "[result]" line?