Learn to build apps with us! We'll be running our fantastic 2-day iOS developer training in Melbourne next month! Join us on the 2nd and 3rd of May, and learn all you need to know for iOS development. Only a few tickets left! Everyone gets an electronic copy of our new book, Learning Swift. Email us if you have any questions.
We build amazing iPhone and iPad apps. We recently built ABC Play School Play Time and Art Maker for iPad, and recently wrote Learning Cocoa with Objective-C Fourth Edition and the iOS Game Development Cookbook for O'Reilly. This is our blog.
Complicated stories don't have to be complicated to build. We've already seen how Twine has made it easier than ever to create interactive fiction. Another tool, Yarn, has taken inspiration from Twine, and made it awesomely simple to craft interactive fiction.
This is where we come in. We also love telling stories, so we're absolutely delighted to introduce Yarn Spinner, an open source implementation of the Yarn language that's designed to make dialogue in your games a snap.
We built a tiny little demo game, which is set in space and available for you to play right now! It requires a keyboard to play it, and is compatible with most modern browsers.
Yarn is a very simple text based format, designed to let you write interactive, branching conversations with the greatest of ease. Here's a snippet:
// Check to see if we've spoken to Sally already <<if $spoken_to_sally is 0>> // We haven't spoken to her - run the initial conversation Player: Hey, Sally. Sally: Oh! Hey. Sally: You kind of snuck up on me. Sally: Don't do that. // Remember that we've spoken to her <<set $spoken_to_sally to 1>> <<else>> // Run a different conversation Player: Hey. Sally: Hi. <<endif>> // Now present some options to let the player choose how they'll respond. [[Anything exciting happen on your watch?|Sally.Watch]] [[See you later.|Sally.Exit]]
What's Yarn Spinner?
Yarn Spinner is a parser and runner for Yarn. It's written in C#, and is designed to be super simple to integrate into Unity games. You just drag and drop a few objects, drag in your Yarn file (which you've written using the excellent Yarn editor), and you've got dialogue running!
I'm already using Yarn's original parser. What does Yarn Spinner do differently?
Yarn Spinner adds a number of useful features:
- Functions are now part of the language, and you can write your own in C#, where they'll be available to your scripts.
- The expression parser is quite a bit more powerful, and can handle most things you throw at it.
- Yarn Spinner is available as a separate .DLL file, which means that it's more separated from your Unity code.
- Yarn Spinner adds more types of values to the language. Where you previously only had numbers, you now also get strings, booleans and null! Woo, programmer toys!
Is it Open Source?
Yes! The whole source code is available under the MIT license, which means that you can use it in commercial games if you want! The only requirement is attribution.
Where can I learn more?
Slides from our talk at Linux.conf.au 2016, on Swift Functional Programming, are available below. Notes and links to come shortly.
If you're interested in attending our intensive 2-day iOS Developer Training Workshop in Melbourne, to be run in the Melbourne CBD on May 9 and May 10 this year, please let us know. When we open registrations, we'll get back to you with a discount code and further information.
Our intensive 2-day workshop is designed for programmers who are proficient with any modern, object-oriented language, such as Java, C++, C#, Python, Ruby, or similar. No knowledge of Swift, Objective-C, or the Apple frameworks is required. This iOS Developer Training Workshop will teach the latest, best practices for iOS development using Swift.
Our team has written more than ten highly regarded, popular books on iOS and Apple development, and has been teaching software development for Apple platforms for more than 15 years. You're not committing to anything by submitting this form.