Skip to content

Instantly share code, notes, and snippets.

@Ratstail91
Created December 11, 2019 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ratstail91/d7471788258b8bfb1b39cfda9a043279 to your computer and use it in GitHub Desktop.
Save Ratstail91/d7471788258b8bfb1b39cfda9a043279 to your computer and use it in GitHub Desktop.
/*
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