O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Releasing HTML5 Games for Windows 8

Book Description

Windows 8 presents an incredible opportunity for distributing and monetizing HTML5 games, and this guide shows how you can profit from it. You’ll learn everything you need to know about porting your original web-based JavaScript game to the new "touch-first" version of Windows, as well as several options for selling your game in Windows Store.

Windows 8 is a big leap forward for developers because it treats HTML5 as a first-class citizen, alongside C# and C++. Interactive development expert Jesse Freeman explains how Windows 8 works, gets you started with Visual Studio Express (it’s free!), and uses a case study to show you how to port an HTML5 game with ease.

  • Learn which games and JavaScript libraries work best on Windows 8
  • Adjust artwork for different screen resolutions and Windows 8 features
  • Accommodate mouse, keyboard, touch, and other game controls
  • Optimize your game to run well on any Windows 8 device
  • Understand the steps for publishing your game to Windows Store
  • Explore fixed price, trial mode, ad support, and in-app purchase options
  • Use a web-first workflow to ensure your game runs on many other platforms

Table of Contents

  1. Dedication
  2. Preface
    1. Audience
    2. Assumptions This Book Makes
    3. Conventions Used in This Book
    4. Safari® Books Online
    5. How to Contact Us
    6. Acknowledgments
  3. 1. Getting Started with Windows 8
    1. Why Windows 8
    2. What You Need
    3. Windows 8 Hardware
      1. Devices
    4. Windows 8 Versus Windows RT
    5. Introduction to Windows 8
      1. Live Tiles
      2. Charms
      3. Settings
      4. Windows Store
      5. Shortcuts
      6. Windows 8.1
      7. BizSpark and DreamSpark
  4. 2. Getting Started with Visual Studio
    1. What Games Work Best
    2. Introduction to Visual Studio Express
    3. Understanding Visual Studio Project Structure
    4. Moving Your Code Over
    5. Understanding the App Lifecycle
    6. Running Your Game for the First Time
    7. Tips and Tricks for Running Your Game on Windows 8
      1. Disable Touch Behaviors via CSS
      2. File Paths and Loading Locally
      3. Avoid Modernizr Libraries
  5. 3. Screen Resolution and Artwork
    1. Windows 8 Resolutions
    2. Scaling Games for Full Screen
    3. Understanding Snap View
    4. Upscaling Artwork
    5. Designing for Multiple Resolutions
    6. Live Tiles
    7. Splash Screen
    8. Tips and Tricks for Working with Artwork on Windows 8
      1. Use Sprite Sheets or Texture Atlases
      2. Render for Native Resolution
      3. Handling Edge Cases
      4. Set a Maximum Resolution
  6. 4. Handling Game Controls On Windows 8
    1. Working with Traditional Input
    2. Working with Touch
    3. Working with Controllers and Game Pads
    4. Knowing When to Use What
    5. Tips and Tricks for Windows 8 Game Input
      1. Contextual Controls
      2. Avoid Configuration Screens
      3. Instruction Screen
  7. 5. Debugging and Optimization
    1. Using the Console
    2. Debugging and Breakpoints
    3. DOM Explorer
    4. Remote Debugging
    5. Optimizing Graphics
    6. Optimizing Code
    7. Optimizing for the Lowest Common Denominator
    8. Tips and Tricks for Further Optimization
      1. Debug Builds Are Slower Than Production Builds
      2. Avoid Multiple Draw Calls to the Canvas
      3. Use Best Practices
  8. 6. Publishing Your Game to the Windows 8 Store
    1. Reserving Your Game’s Name
    2. Submitting Your Game with Visual Studio
    3. Creating Collateral for Your Game
    4. Submitting Updates and New Releases
    5. Reviewing Your Game’s Stats and Ratings
    6. Tips and Tricks for Publishing a Game to the Windows Store
      1. Privacy Policy
      2. Setup Capabilities
  9. 7. Monetization
    1. Setting a Fixed Price
    2. Trial Mode
    3. Incorporating Ads into Your Game
    4. In-App Purchase
    5. Tips and Tricks for Monetization
      1. Promote Your Game
      2. Incentivize Players to Upgrade from a Trial
      3. Get People to Rate Your Game
      4. Make Compelling IAP Options
      5. Get Reviews
  10. 8. Back to the Web
    1. A Web-First Workflow
    2. Setting Up a Local Web Server
    3. Using Node.js
    4. Project Structure
    5. Modifiying the Default JavaScript File
    6. Tips and Tricks
      1. Modularize Your Code
      2. Test Regularly
      3. Use Automation
  11. 9. Case Study: Heroine Dusk
    1. About the Game
    2. Getting Started
  12. 10. Windows 8 Resources
    1. Port to Windows 8 Task List
      1. Mandatory
    2. WinJS App Lifecycle
    3. Windows Store JavaScript Samples
      1. Live Tiles
        1. Visual Studio Sample
      2. Flyout Panels
        1. Visual Studio Sample
      3. Loading/Saving to Local File System
        1. Visual Studio Sample
      4. Accelerometer Support
        1. Visual Studio Sample
      5. Pen Support
        1. Visual Studio Sample
      6. Splash Screen
        1. Visual Studio Sample
      7. Dialog Boxes
        1. Visual Studio Sample
      8. Trial and In-App Purchase
        1. Visual Studio Sample
    4. Installing Windows 8 on a Mac
  13. About the Author
  14. Colophon
  15. Copyright