to-launch-an-app-step-2

This post is part of a series of updates leading up to the launch of Double Dynamo for iOS.

Previously

Last Thursday I presented a timeline of how I got to this point in the development of Double Dynamo. I also mentioned I'd be working on an in-game tutorial for new players that would be done "some time Tuesday or Wednesday". So how did I stack up?

These things are always a little fuzzy, but I think my prediction was spot-on: the basic framework was working in the app by Monday evening, the entire script was implemented by Tuesday afternoon, and I spent this morning tweaking and polishing. In another sense I was wrong, though, since I'll undoubtedly be adjusting some things based on feedback from my testers. I'm still counting this as a win.

tutorial_match

Non-technical readers may wish to skip to the next section. The process was pretty straightforward: I already knew how I wanted to write the code, so I went ahead and wrote down the tutorial script in as much detail as possible. This was surprisingly difficult. For less than one minute of gameplay I needed 23 controlled steps. Each step consists of a trigger (e.g. the user taps the screen) and an array of commands (e.g. pause/unpause, show an informational dialog, etc.). Then I compiled a list of all of the commands and triggers in the script and implemented them, building out the script in the JSON configuration file and testing as I went. This is what part of the config looks like:

{
    "commands": [
        {
            "type": "pause"
        },
        {
            "type": "centerSymbols"
        },
        {
            "message": "The boxes have the same COLOR inside.",
            "position": "bottom",
            "type": "message"
        }
    ],
    "trigger": {
        "type": "beat",
        "value": 2
    }
},
{
    "commands": [
        {
            "type": "showButtons"
        }
    ],
    "trigger": {
        "type": "tap"
    }
},
// ...

In English: on the 2nd beat pause the game, center the symbols in the boxes, and show a dialog. When the user taps anywhere, show the match buttons (the dialog dismisses itself on tap).

This is pretty nice because it's not too verbose, it's easy to understand, and it's easy to write. I'd prefer if the "trigger" object came before "commands", but the JSON formatter I'm using orders the keys alphabetically and I'm not about to spend time messing with it.

Questions about how the system works or how I handled it in code? Leave a comment!

What’s Next?

As I mentioned in the last installment, Facebook integration is next on the list. I'm also going to look into integrating Apple's Game Center in the next few days. I haven't done either one before and I don't really have a sense of how hard it'll be, but I'll check back in by Monday to update you on my progress. Until then!

Like Double Dynamo? Sign up for the mailing list to keep up to date!

comments powered by