How to Code Sports Games for Amazon Alexa (Plus Some Award-Winning Examples)

As an avid sports fan and Alexa Champion with 10+ years of professional development experience, I‘ve had the incredible opportunity to combine my passions by building voice-first games for the Amazon Alexa platform. It‘s an exciting space that‘s seen explosive growth, with the number of voice assistant users expected to reach 8 billion by 2023 (up from 2.5 billion at the end of 2018), driving $80 billion in voice commerce (Juniper Research).

Alexa Skill Growth
Alexa skill count over time (Voicebot.ai)

Sports games in particular have huge potential on this platform, offering fans a whole new level of immersion and engagement through the power of voice. Amazon has leaned heavily into this use case, releasing an entire Alexa Game Skill API to help developers build more complex and interactive gaming experiences.

Over the past few years, I‘ve published a variety of sports-themed voice games that have earned recognition from Amazon and been featured in their Skill Store. In this post, I‘ll walk through my experience designing and developing these skills, highlighting some key strategies for creating compelling voice-first gameplay. Whether you‘re an experienced developer looking to get into voice or a hobbyist excited to try a new medium, this guide will equip you with a solid foundation for building Alexa games.

Designing Voice-First Games

When setting out to design a game for Alexa, it‘s critical to deeply consider the unique affordances and constraints of the voice-only medium. Without visuals to rely on, the experience needs to be conveyed entirely through spoken prompts, sound effects, and user speech. This can be challenging, but also liberating in that it forces you to distill your design down to the most essential and impactful elements.

Core tenets I follow when designing voice games:

  1. Keep it simple and intuitive: Limit the number of options and strive for simple, discoverable commands. Provide short, clear prompts to guide the user at each turn.

  2. Provide key information up-front: Front-load important context so players don‘t get lost. Frequently re-state the key objective and currently available options.

  3. Create an engaging soundscape: Thoughtfully weave together spoken prompts, sound effects, and music clips to establish a rich, immersive audio environment that pulls the user into your world.

  4. Craft a compelling narrative: Even simple games benefit from giving the player a goal to strive for and a reason to care. Establish the stakes and inject some personality through flavor text.

  5. Allow for user agency: Make the player feel like they are in the driver‘s seat and that their choices matter. Provide periodic opportunities for them to make meaningful decisions that impact the outcome.

  6. Keep sessions short: Design for quick 2-5 minutes games that can be played repeatedly. Always have a brisk onboarding flow to get players into the action as fast as possible.

  7. Play to the strengths of voice: Lean into elements like humor, suspense, narrative, and roleplay that work particularly well in an audio-only environment. Voice is an intimate medium, so don‘t be afraid to be conversational.

I find it helpful to start the design process by mapping out the overall user flow and core gameplay loop on a whiteboard or storyboarding tool. This allows you to quickly visualize the game structure and all the possible paths a user can take before diving into implementation details.

Alexa Game Storyboard
Storyboard for an Alexa-powered soccer penalty shootout game

Implementing Alexa Game Skills

Once you have a solid design, it‘s time to start building your actual skill using the Alexa Skills Kit (ASK) SDK. The bulk of your skill code will live in the various intent handlers that get triggered by user utterances.

To make Alexa‘s responses more dynamic and lifelike, you‘ll want to leverage Speech Synthesis Markup Language (SSML). This allows you to add expressive inflection, pauses, and audio embeds for a richer voice experience.

Some key SSML tags worth utilizing:

  • <emphasis>: Add emphasis to a word or phrase
  • <prosody>: Fine-tune the pitch, rate, and volume of speech
  • <say-as>: Specify the proper pronunciation for uncommon words
  • <audio>: Embed short recorded audio clips
  • <break>: Insert pauses of varying lengths

Here‘s an example of what a response string might look like with SSML:

const response = `<speak>
  <audio src="soundbank://sports_crowd_01"/>
  <p>
    Welcome to <emphasis level="strong">Penalty Kicks</emphasis>! 
    <break time="1s"/>
    You‘re now in a nail-biting one-on-one showdown against the world‘s top goalkeeper. 
    The score is currently <prosody rate="slow">${gameState.userScore} - ${gameState.opponentScore}</prosody>
  </p>
  <p>
    You have ${gameState.attemptsLeft} attempts left. 
    <break time="500ms"/> 
    Where would you like to aim your shot? You can say <emphasis level="moderate">left</emphasis>, 
    <emphasis level="moderate">center</emphasis>, or <emphasis level="moderate">right</emphasis>.
  </p>
</speak>`;

To track all of the dynamic information being surfaced (score, attempts left, etc.) you‘ll want to leverage session attributes to store game state that persists throughout a single playthrough:

const gameState = {
  userScore: 0,
  opponentScore: 0, 
  attemptsLeft: 5,
  lastAttempt: ‘RIGHT‘,
  lastResult: ‘BLOCKED‘
};

return handlerInput.responseBuilder
  .speak(response)
  .reprompt(reprompt)
  .withSimpleCard(cardTitle, cardText)
  .getResponse();

Saving game state as session attributes to be recalled on the next turn

For more advanced functionality, you can tap into the Alexa Game Skill API to utilize features like:

  • Game state management: Automatically save game progress to be resumed later
  • In-skill purchasing: Offer premium upgrades like extra lives or bonus levels
  • Leaderboards: Allow players to compete for high scores against each other

By creatively combining these SDK features, you can craft polished, full-featured voice games that rival the quality of traditional mobile offerings. To date, some of my most successful sports skills include:

Launching & Growing Your Game

With your skill built and thoroughly tested, you‘re ready to unleash it to the world! The first step is getting it certified and published in the Alexa Skill Store. To do this, you‘ll need to step through Amazon‘s certification checklist and verify you meet their criteria around:

  • Policy requirements
  • Security best practices
  • Functional tests
  • User experience tests

The certification process typically takes 1-2 days, and Amazon will email you to confirm approval or request changes. Once your skill is live, it‘s critical to create compelling metadata to help it get discovered, including:

  • Short and detailed descriptions that sell your experience
  • Engaging example phrases that highlight key features
  • An eye-catching skill icon
  • Thorough category tags and keywords

Skill Store Listing
Example metadata for the featured skill of the week

To drive further awareness and adoption, I‘d recommend:

  • Creating video previews and radio commercials to demo the experience
  • Posting on relevant subreddits and web forums
  • Pitching local media and podcasts for coverage
  • Cross-promoting to your email list and social media following

As you start gaining traction, dive into the Alexa Developer Console analytics to glean key insights around usage patterns, retention, and game performance. Pay particular attention to session duration, number of turns per session, and where users are most commonly dropping off in your skill flow.

Alexa Skill Metrics
Key metrics to track in the Alexa Developer Console

These data points will help you identify friction points in the user experience and prioritize updates accordingly. I find it helpful to periodically survey my users in-skill to collect more qualitative feedback around what‘s resonating and where I have room for improvement.

The Future of Alexa Games

We‘re still in the early days of voice games, and I‘m incredibly bullish on their long-term potential. In the next few years, I expect we‘ll see a proliferation of monetization options (both ads and in-skill purchases), richer visual integrations on devices with screens like the Echo Show, and more big brands entering the space.

Echo Show Game
Jeopardy! game on an Echo Show with visuals

Amazon has also been investing heavily in the tooling and infrastructure to help developers build more ambitious voice experiences, including:

All of these advancements will open up new creative possibilities and bring voice-first games closer in line with console and mobile experiences. I can‘t wait to see what the developer community dreams up!

Getting Started with Alexa Game Development

If you‘re excited by the potential of voice gaming and want to dive in yourself, here are some suggested resources to explore:

Most importantly, dream big and don‘t be afraid to experiment! We‘re charting new territory in voice game design, and many of the biggest hits are still yet to be conceived. Whether you‘re an indie hacker or part of a larger studio, now is the perfect time to bet big on Alexa gaming. I‘ll be cheering you on and eagerly awaiting what you ship.