Skip to content

Instantly share code, notes, and snippets.

@amonks
Last active August 29, 2015 14:23
Show Gist options
  • Save amonks/cae1de50224ec8a58d8d to your computer and use it in GitHub Desktop.
Save amonks/cae1de50224ec8a58d8d to your computer and use it in GitHub Desktop.
game = {
player: {
starting_moment: "go home"
},
moments: [
{
title: "go home",
image: "home.jpg",
text: "you live here",
// you have two clickable options: "look at all your shit.", and "text arjun about maybe having a show"
moments: [
{
title: "look at all your shit.",
// the image doesn't change.
// this text replaces the "you live here" text.
text: "You look at all your shit. You got all the shit.",
// even after looking at all your shit, you can still text arjun about maybe having a show
// we aren't defining the moment here, because you can also do it *before* "look at all your shit"
// the game knows it's a reference to another moment cuz it's a string instead of an object.
moments: ["home > text arjun about maybe having a show"]
},
{
title: "text arjun about maybe having a show",
text: "arjun's like 'yeah totally come over whenever'",
moments: [
// the moment "go to arjuntina" only shows up after deciding to have a show
"go to arjuntina",
// but the real question is, if someone looks at all their shit after texting arjun,
// they still eventually need to go to Arjuntina. They shouldn't have to text arjun again, though.
// should we add something in "look at all your shit" or here?
"go home > look at all your shit"
]
}
]
},
// this moment isn't under "home", so it can't inherit images or text from home either.
// It's like a whole different location or something.
{
title: "go to arjuntina",
image: "arjuntina.jpg",
text: "this is a real fun party, no?",
moments: [
{
title: "start the show",
// once you start the show, the image changes.
image: "shredding.jpg",
text: "you begin to shred incredibly. It's pretty fun.",
moments: [
{
title: "end your set",
// if we didn't include an image here, it would assume "shredding.jpg"
image: "arjuntina.jpg",
text: "That was fun. Now it's over.",
moments: [
// how do we make it so that if they go home, they can't text arjun again?
"go home"
]
}
]
},
{
title: "talk to arjun",
// this moment doesn't define an image, so it uses "arjuntina.jpg" from the parent.
text: "Arjun says something or whatever.",
moments: [
"go to arjuntina > start the show",
{
title: "say 'how lame!'",
text: "Arjun scowls. It makes you sad.",
moments: ["go to arjuntina > start the show"]
},
{
title: "say 'how dope!'",
text: "Arjun looks pleased. He gives you a certificate",
moments: [
"go to arjuntina > start the show",
{
title: "say 'thanks for the certificate!'",
text: "Arjun nods.",
moments: ["go to arjuntina> start the show"]
}
]
}
]
}
]
}
]
};
@amonks
Copy link
Author

amonks commented Jun 17, 2015

all this nesting might be real cool for making things chronological but it also might be a huge unwieldy pain in the ass.

@amonks
Copy link
Author

amonks commented Jun 17, 2015

here are the main questions i see that we'd still have to answer with this approach.

  1. if a moment is a child nested within a parent moment, what stuff gets inherited from the parent?
    • image if not defined in child
    • text if not defined in child, probably never irl
    • never title
    • never object gets
    • but moments lists are the tricky thing. I'm leaning towards never, but that brings us to question 2:
  2. (addressed on lines 28 through 30 and on line 55) how do we deal with exceptions?
    • we could keep track of which moments have happened and add some kind of "before: moment" or "after: moment" syntax
    • I'm sure there are other solutions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment