Last week, we released TwilioQuest extensions, a toolkit for you to create your own content and missions with TwilioQuest. What better way to kick the tires on these new tools, than with a retro-game themed hackathon? We challenged the 300 students at Hack-cade to build the best TwilioQuest extension. Although all the submissions were spectacular, one in particular captured our hearts and took the prize. Read on to learn how to create a winning TwilioQuest extension, from La’Kaleigh, creator of bot.NET.
Sharing the love of C#
La’Kaleigh’s extension, named bot.NET, teaches C# with a storyline driven by wordplay and references to the .NET community. A malicious botnet takes control of an R&D facility, corrupting the resident Dotnet bots, based on the .NET mascot. The player must build a C# program to kick out the botnet and restore the Dotnet bots to normal function.
During the hackathon, La’Kaleigh used a heap of TwilioQuest extension features. She imported custom sprites to use in her map, edited with Tiled. The bot.NET bots are custom objects, and users are taught C# basics through a series of objectives. Most impressive though is the validator used to check whether users have completed the assigned tasks.
Validating code with syntax trees
Validators in TwilioQuest are short scripts that check whether an objective has been completed. For a simple objective, such as asking a user a knowledge-based question, the validator could be as simple as an equality check on a submitted string. Other validators are more complicated. How do you check if someone has written a correct program, for example? You could test for a particular string of code, but there’s often many ways to write the same piece of code, and it being different doesn’t mean it doesn’t produce the correct result. Many TwilioQuest missions check submitted code by actually running it and checking the output.
What’s next for Bot.net?
La’Kaleigh has big plans for the future of this extension. Since the hackathon, she has already added a new NPC, and cleaned up some code - code can get messy during a 24-hour hackathon. She hopes to revisit the validator, and apply Rosalyn not only to the player’s code, but to the ideal solution, comparing the syntax trees directly. The Dotnet bots and Kyle aren’t the only characters in the mission. La’Kaleigh has already created an animated monster, this cute little green fella, inspired by the ASP.NET monsters from Channel 9. The monsters will feature in future objectives teaching about ASP.NET.
If you want to follow along with the development of Bot.net, or try it yourself, you can find the extension on La’Kaleigh’s GitHub. Follow the TwilioQuest extension documentation to install the extension.
Build your own TwilioQuest mission
Bot.net was built with the TwilioQuest extension template. The template gets you started quickly with examples for all the major features. Grab the template, and follow the Get Started guide to build your own extension.
Looking for more inspiration? Check out the other TwilioQuest submissions at Hack-cade. These extensions range from treasure hunts to Tensorflow tutorials, using a wide range of TwilioQuest features (and even some that weren’t documented!).
If you have questions or want to share your extension with the community, join us in the TwilioQuest Discord, or on the Twilio Community forum. Our weekly Twitch stream also regularly features TwilioQuest extension development, and Q&A with the developers.