Skip to content

Instantly share code, notes, and snippets.

@Sintrastes
Created January 8, 2022 17:01
Show Gist options
  • Save Sintrastes/0621f89e2c26d9b963df0f0f3fc14e35 to your computer and use it in GitHub Desktop.
Save Sintrastes/0621f89e2c26d9b963df0f0f3fc14e35 to your computer and use it in GitHub Desktop.
Game DSL example
def test(player1: Player, player2: Player) = gameAction {
transaction(
give = MyItem,
from = player1,
to = player2
)
startDialog {
speak(player1, "Thanks a lot!")
prompt(player1, "Do you want to go sledding with me?",
Map(
"Yes" -> {
speak(player1, "Sweet!")
},
"No" -> {
speak(player1, "Ok. Maybe some other time then.")
}
)
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment