[SOLVED] How to randomly pick phrases, then change them
Posted: Wed Jan 16, 2019 1:07 pm
My game is separated into chapters, so I created a fake loading screen to separate them. For the fun facts part of the loading screen, I need the game to randomly pick from the 9 facts and change them every 20 seconds. Screens aren't my strong point, so I don't really know how to go about doing that.
Code: Select all
screen loading():
add gui.loading_screen_background
text "Fun fact: [fact]":
font "gui/fonts/Milkshake.ttf"
size 48
xpos 32
ypos 516
text "Chapter [CN]":
font "gui/fonts/Milkshake.ttf"
size 150
color "#000000"
xpos 687
ypos 145
imagebutton auto "gui/loading screen/continue_%s.png" action Return:
xpos 1400
ypos 945
$ randomfact = renpy.random.randint(1,9)
if randomfact == 1:
python:
fact = "Fact 1"
if randomfact == 2:
python:
fact = "Fact 2"
if randomfact == 3:
python:
fact = "Fact 3"
if randomfact == 4:
python:
fact = "Fact 4"
if randomfact == 5:
python:
fact = "Fact 5"
if randomfact == 6:
python:
fact = "Fact 6"
if randomfact == 7:
python:
fact = "Fact 7"
if randomfact == 8:
python:
fact = "Fact 8"
if randomfact == 9:
python:
fact = "Face 9"