Pro Android Web Game Apps: Using HTML5, CSS3 and JavaScript

Book description

Dive into game development and create great multiplayer online games with Pro Android Web Game Apps. This hands-on guide covers both the theory and practice of browser game development for the Android platform. You'll use cutting-edge technologies to make game engines in your browser, establish real-time server communication, and create amazing gaming experiences with artificial intelligence and rich media.

Bring your knowledge of HTML and JavaScript to the next level with Pro Android Web Game Apps. You are guided through exciting projects that give you firsthand experience with core game app development concepts. You'll start with a blank HTML page, and by the end of the book, have the skills needed to create a multiplayer online game with rich graphics, sound, animation, and more—even if you have no previous games development or server-side experience.

What you'll learn

  • How to set up your development environment, run applications, and debug and profile code

  • How to work with graphics and animations in a browser

  • How to optimize rendering and make your games run faster

  • How to handle events and user inputBuild an isometric game engineLearn the basics of 3D programming and WebGL

  • How to use JavaScript to create full-blown server-side support for your games

  • How to enrich your games using artificial intelligence

  • Who this book is for

    The book is intended for developers with some generic HTML and JavaScript background who want to boost their experience to the next level and learn how to utilize browsers to build attractive multiplayer games for Android platform. No previous games development or server-side knowledge is required.

    Table of contents

    1. Titlepage
    2. Dedication
    3. Contents at a Glance
    4. Contents
    5. About the Authors
    6. Acknowledgments
    7. Introduction
    8. Chapter 1: Getting Started
      1. Tools
      2. Techniques
      3. Summary
    9. Chapter 2: Graphics in the Browser: The Canvas Element
      1. The Anatomy of the Game
      2. Drawing Inside the Browser
      3. The Basic HTML Setup
      4. What Is Canvas?
      5. Drawing Shapes
      6. Strokes and Fills
      7. Context State and Transformations
      8. The Sample Game Project Result
      9. Summary
    10. Chapter 3: Creating the First Game
      1. HTML5 Game Skeleton
      2. Game Architecture
      3. Making the Game
      4. Summary
    11. Chapter 4: Animation and Sprites
      1. Sprites
      2. Basics of Animation
      3. Summary
    12. Chapter 5: Event Handling and User Input
      1. Browser Events
      2. Custom Events
      3. Custom Event Listeners and Emitters
      4. Custom Events
      5. Advanced Input
      6. Simulating Joystick
      7. Summary
    13. Chapter 6: Rendering Virtual Worlds
      1. Tile Maps
      2. Optimizing Rendering Performance
      3. World Objects
      4. Isometric View
      5. Summary
    14. Chapter 7: Making an Isometric Engine
      1. Setup
      2. Isometric Terrain
      3. Rendering Objects
      4. Dirty Rectangles
      5. UI and Layer Manager
      6. Interaction
      7. Summary
    15. Chapter 8: 3D in a Browser
      1. Introducing 3D Rendering
      2. How 3D Rendering Works
      3. The Hello World 3D Engine
      4. Summary
    16. Chapter 9: Using WebGL
      1. Basics of WebGL
      2. Basic Example: Render a 3D Cube
      3. Exploring WebGL
      4. Summary
    17. Chapter 10: Going Server-Side
      1. Node.js Basics
      2. Writing Scripts for Node.js
      3. Getting Real: Building a Server for the Game
      4. Understanding Middleware
      5. Housekeeping
      6. Summary
    18. Chapter 11: Talking to the Server
      1. The Evolution of Networking in Browsers
      2. Server Setup
      3. Using XMLHttpRequest API for Basic HTTP Requests
      4. Reverse Ajax
      5. Testing Transports in the Field
      6. Summary
    19. Chapter 12: Making Multiplayer Games
      1. The Anatomy of a Network Game
      2. Game Lobby with Socket.IO
      3. Adding the Gameplay
      4. Summary
    20. Chapter 13: AI in Games
      1. Do I Need AI in My Game?
      2. Introducing Pathfinding
      3. Graphs
      4. Building Pathfinding AI
      5. Decision Making
      6. Summary
    21. Chapter 14: JavaScript Game Engines
      1. Graphical APIs, Libraries, and Game Engines
      2. Crafty
      3. Summary
    22. Chapter 15: Building Native Applications
      1. Native Applications
      2. Setting up Apache Cordova (PhoneGap)
      3. Building Native Application
      4. Preparing for Markets
      5. Summary
    23. Chapter 16: Adding Sound
      1. Audio on Web Pages
      2. Using SoundManager2
      3. Playing Sound in Cordova Applications
      4. User Experience
      5. Summary
      6. Going Further
    24. Appendix A: Debugging Client-side JavaScript
      1. Debug Example
      2. Debugging in a Desktop Browser
      3. Debugging on a Mobile Device
      4. Logging (Almost) Without Code Changes
      5. weinre
      6. Summary
    25. Index

    Product information

    • Title: Pro Android Web Game Apps: Using HTML5, CSS3 and JavaScript
    • Author(s): Juriy Bura, Paul Coates
    • Release date: October 2012
    • Publisher(s): Apress
    • ISBN: 9781430238195