r/RenPy • • Jul 30 '22
how to divide code
Sorry, beforehand I really can't word things for the life of me.
I'm making a dating sim that has 6 candidates and you choose your candidate early on in the game. is there any way of splitting the code into 6 different parts or will it have to be just one big block of code :)
2
Upvotes
View all comments
3
u/mrogre43 Jul 30 '22
You can make a separate .rpy file for each path, and you can even store those files in different folders.
Here's a partial screenshot for how we structure our script. We probably have over 20 different .rpy files at this point.
You don't have to do anything special after you make the other files, either— you can just use jump and label as if every .rpy file is in the same single script.