| 1 | <h2>Comments</h2> |
| 2 | <pre><code># This is a comment</code></pre> |
| 3 | |
| 4 | <h2>Strings</h2> |
| 5 | <pre><code>"foo \"bar\" baz" |
| 6 | 'foo \'bar\' baz' |
| 7 | """ "Multi-line" strings |
| 8 | are supported.""" |
| 9 | ''' 'Multi-line' strings |
| 10 | are supported.'''</code></pre> |
| 11 | |
| 12 | <h2>Python</h2> |
| 13 | <pre><code>class Dog: |
| 14 | |
| 15 | tricks = [] # mistaken use of a class variable |
| 16 | |
| 17 | def __init__(self, name): |
| 18 | self.name = name |
| 19 | |
| 20 | def add_trick(self, trick): |
| 21 | self.tricks.append(trick)</code></pre> |
| 22 | |
| 23 | <h2>Properties</h2> |
| 24 | <pre><code>style my_text is text: |
| 25 | size 40 |
| 26 | font "gentium.ttf"</code></pre> |
| 27 | |
| 28 | <h2>Configuration</h2> |
| 29 | <pre><code>init -1: |
| 30 | python hide: |
| 31 | |
| 32 | ## Should we enable the use of developer tools? This should be |
| 33 | ## set to False before the game is released, so the user can't |
| 34 | ## cheat using developer tools. |
| 35 | |
| 36 | config.developer = True |
| 37 | |
| 38 | ## These control the width and height of the screen. |
| 39 | |
| 40 | config.screen_width = 800 |
| 41 | config.screen_height = 600 |
| 42 | |
| 43 | ## This controls the title of the window, when Ren'Py is |
| 44 | ## running in a window. |
| 45 | |
| 46 | config.window_title = u"The Question"</code></pre> |
| 47 | |
| 48 | |
| 49 | <h2>Full example</h2> |
| 50 | <pre><code># Declare images used by this game. |
| 51 | image bg lecturehall = "lecturehall.jpg" |
| 52 | image bg uni = "uni.jpg" |
| 53 | image bg meadow = "meadow.jpg" |
| 54 | image bg club = "club.jpg" |
| 55 | |
| 56 | image sylvie normal = "sylvie_normal.png" |
| 57 | image sylvie giggle = "sylvie_giggle.png" |
| 58 | image sylvie smile = "sylvie_smile.png" |
| 59 | image sylvie surprised = "sylvie_surprised.png" |
| 60 | |
| 61 | image sylvie2 normal = "sylvie2_normal.png" |
| 62 | image sylvie2 giggle = "sylvie2_giggle.png" |
| 63 | image sylvie2 smile = "sylvie2_smile.png" |
| 64 | image sylvie2 surprised = "sylvie2_surprised.png" |
| 65 | |
| 66 | # Define characters used by this game. |
| 67 | define s = Character('Sylvie', color="#c8ffc8") |
| 68 | define m = Character('Me', color="#c8c8ff") |
| 69 | |
| 70 | |
| 71 | # The game starts here. |
| 72 | label start: |
| 73 | |
| 74 | $ bl_game = False |
| 75 | |
| 76 | play music "illurock.ogg" |
| 77 | |
| 78 | scene bg lecturehall |
| 79 | with fade |
| 80 | |
| 81 | "Well, professor Eileen's lecture was interesting." |
| 82 | "But to be honest, I couldn't concentrate on it very much." |
| 83 | "I had a lot of other thoughts on my mind." |
| 84 | "And they all ended up with a question." |
| 85 | "A question, I've been meaning to ask someone." |
| 86 | |
| 87 | scene bg uni |
| 88 | with fade |
| 89 | |
| 90 | "When we came out of the university, I saw her." |
| 91 | |
| 92 | show sylvie normal |
| 93 | with dissolve |
| 94 | |
| 95 | "She was a wonderful person." |
| 96 | "I've known her ever since we were children." |
| 97 | "And she's always been a good friend." |
| 98 | "But..." |
| 99 | "Recently..." |
| 100 | "I think..." |
| 101 | "... that I wanted more." |
| 102 | "More just talking... more than just walking home together when our classes ended." |
| 103 | "And I decided..." |
| 104 | |
| 105 | menu: |
| 106 | |
| 107 | "... to ask her right away.": |
| 108 | |
| 109 | jump rightaway |
| 110 | |
| 111 | "... to ask her later.": |
| 112 | |
| 113 | jump later</code></pre> |