Scenes
clocks-in-a-cooler edited this page Sep 3, 2018
·
2 revisions
scene_handler
, abbreviated to SH
, displays scenes in something similar to Java's card layout, or what you would see on those step-by-step installers:
Except like this:
-
create_scene()
— starts a scene. -
next_scene()
— when the player hits the "next!" button. (see image above) -
create_scene_content()
— checks for every part of a scene. Then creates the parts that exist. For example, if a scene has loot, loot is generated; otherwise, loot is not generated.
These functions are used, but cannot be accessed:
A scene needs to be in the correct format for the scene handler to interpret it properly.
A scene looks something like this:
example_scene = {
'title': 'the title of the scene',
'start': { /* the starting part of the scene */
'text': 'text to display for the starting part of the scene',
'loot': {/* things the player can get from seeing this scene */
'cucumber seeds': { //just use the name of the item
min: 5, //at least five
max: 10, //at most ten
chance: 0.75, //75% chance of seeing it. You can set this to 1 for a guaranteed chance.
},
'tomatoes': { //and so on, for each item
min: 1,
max: 1,
chance: 0.01,
},
},
'buttons': {
'end the scene': 'end', //if you want to end the scene, use 'end'
'next_scene': {
'one': 0.4,
'two': 0.6,
/* otherwise, use the name of the next part(s) and the chance of getting them. please make sure the chances add up to 1 */
}
},
},
'one': {
//and so on, for each part of the scene
},
'two': {
//blah blah blah...
}
}
At the very least, have a title
. In scenes
, have a start
-ing scene and an end
button somewhere.