Created
December 11, 2019 15:25
-
-
Save Ratstail91/d7471788258b8bfb1b39cfda9a043279 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
images could be saved in the format: | |
character-clothing-expression | |
this would allow setImage() to be split into different functions like: | |
setClothing() | |
setExpression() | |
or setImage() could be smart enough to adapt to specific arguments: | |
hanako.setImage("smile"); //only the expression | |
hanako.setImage("uniform-smile"); //clothing and expression | |
*/ | |
//import the Visual plugin | |
import "Visual"; | |
//create dialog functions | |
const narrator = loadCharacter("", "grey"); //returned instances are callable | |
const hanako = loadCharacter("Hanako", "purple"); //purple dialog text | |
const lilly = loadCharacter("Lilly", "yellow"); //yellow dialog text | |
//load and set the images | |
loadBackground("bedroom"); | |
hanako.setImage("worried"); | |
lilly.setImage("smile"); | |
//dialog section | |
hanako | |
<| "I'm scared." | |
; | |
lilly | |
<| "There's no need to be scared, sweetheart." | |
<| "Just put it in your mouth..." | |
; | |
narrator | |
<| "Hanako put her mouth around it..." | |
; | |
hanako.setImage("shocked"); | |
hanako | |
<| "Mmf! It's delicious!" | |
; | |
hanako.setImage("smile"); | |
lilly | |
<| "I told you croissants are good!" | |
; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment