Created
January 8, 2022 17:01
-
-
Save Sintrastes/0621f89e2c26d9b963df0f0f3fc14e35 to your computer and use it in GitHub Desktop.
Game DSL example
This file contains 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
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