[SOLVED] Pick one image random from a set of images
Posted: Mon Jan 08, 2018 10:23 am
Hi,
I need to randomize the background image from a set of images, this is the code I actually use:
The result is a fixed background with only one image.
How can I randomize the images every 0.50 seconds?
Thanks
Matteo
I need to randomize the background image from a set of images, this is the code I actually use:
Code: Select all
init -1 python:
numbers = [1, 2, 3, 4]
def disco_background(trans, st, at):
num = renpy.random.choice(numbers)
renpy.show(("bg disco%d" % num))
init:
image bg disco:
function disco_background
pause 0.50
repeat
image bg disco1 = "background/disco/disco1.jpg"
image bg disco2 = "background/disco/disco2.jpg"
image bg disco3 = "background/disco/disco3.jpg"
image bg disco4 = "background/disco/disco4.jpg"
How can I randomize the images every 0.50 seconds?
Thanks
Matteo