- ホーム
- > 洋書
- > 英文書
- > Computer / General
Full Description
Get Started Fast with HTML5 Online Game Programming!HTML5 will transform web and mobile gaming. As new browsers rapidly adopt it, HTML5 will do everything "legacy" technologies such as Flash and Silverlight have done-and much more. In Learning HTML5 Game Programming, pioneering developer James L. Williams gives you all the knowledge, code, and insights you'll need to get started fast!Williams combines detailed explanations of HTML5's key innovations with examples, including two case study applications that address the entire development process. He guides you through setting up a state-of-the-art HTML5 development environment; making the most of HTML5's canvas tag, SVG vector graphics, and WebGL 3D; and targeting diverse mobile and social platforms. It's all here: from the essentials of online game design to the nitty-gritty details of performance optimization.About the WebsiteAll code samples and answers to chapter exercises are available for download at www.informit.com/title/9780321767363 and on Github at https://github.com/jwill/html5-game-book.Coverage includes* Understanding the HTML5 innovations that make it possible to create amazingly rich games* Setting up a state-of-the-art open source HTML5 game development environment* Using JavaScript to drive sophisticated interactions between users and games* Building basic games fast, with the prototype-based Simple Game Framework (SGF)* Generating movement and gameplay with the canvas tag and surface* Creating games with SVG vector graphics using the RaphaelJS Javascript library* Using Three.js to build powerful WebGL 3D games with far less complexity* Developing games without JavaScript, using Google Web Toolkit (GWT) or CoffeeScript* Building a complete multiplayer game server using Node.js and WebSockets* Planning and choosing tools for mobile game development with HTML5* Optimizing game performance with offline cache, minification, and other techniquesLearning HTML5 Game Programming is the fastest route to success with HTML5 game development-whether you're a long-time game developer or a web/mobile programmer building games for the first time.
Contents
Chapter 1 Introducing HTML5 1Beyond Basic HTML 1JavaScript 1AJAX 2Bridging the Divide 2Google Gears 3Chrome Frame 3Getting Things Done with WebSockets and Web Workers 4WebSockets 4Web Workers 4Application Cache 5Database API 6WebSQL API 6IndexedDB API 7Web Storage 7Geolocation 8Getting Users' Attention with Notifications 10Requesting Permission to Display Notifications 11Creating Notifications 11Interacting with Notifications 12Media Elements 13Controlling Media 13Handling Unsupported Formats 14HTML5 Drawing APIs 15Canvas 15SVG 16WebGL 16Conveying Information with Microdata 16Chapter 2 Setting Up Your Development Environment 19Development Tools 19Installing Java 19Installing the Eclipse IDE and Google Plugin 20Google Web Toolkit 22Web Server Tools and Options 23Google App Engine 23Opera Unite 23Node.js and RingoJS 23Browser Tools 24Inside the Chrome Developer Tools 24Chrome Extensions 25Safari Developer Tools 26Firebug 26HTML5 Tools 27ProcessingJS 27Inkscape 27SVG-edit 27Raphael 283D Modeling Tools 29Blender 29Chapter 3 Learning JavaScript 31What Is JavaScript? 31JavaScript's Basic Types 31Understanding Arithmetic Operators 32Understanding JavaScript Functions 32Functions as First-class Objects 33Comparison Operators 34Conditional Loops and Statements 35Controlling Program Flow with Loops 36Delayed Execution with setTimeout and setInterval 38Creating Complex Objects with Inheritance and Polymorphism 38Making Inheritance Easier with the Prototype Library 39Learning JQuery 41Manipulating the DOM with Selectors 42JQuery Events 43AJAX with JQuery 43Cross-Site Scripting 44JSON: The Other JavaScript Format 44JavaScript Outside of the Browser 45Mobile Platforms 45JavaScript as an Intermediary Language 45JavaScript on the Desktop 46Server-Side JavaScript 48Chapter 4 How Games Work 51Designing a Game 51Writing a Basic Design Document 51Deciding on a Game Genre 52The Game Loop 53Getting Input from the User 53Representing Game Objects with Advanced Data Structures 54Making Unique Lists of Data with Sets 54Creating Object Graphs with Linked Lists 56Understanding the APIs in Simple Game Framework 57Core API 57Components API 58Resources API and Networking APIs 58Building Pong with the Simple Game Framework 59Setting Up the Application 59Drawing the Game Pieces 61Making Worlds Collide with Collision Detection and Response 63Understanding Newton's Three Laws 63Making the Ball Move 64Advanced Collision Detection and Particle Systems with Asteroids 66Creating Competitive Opponents with Artificial Intelligence 67Adding AI to Pong 68Advanced Computer AI with Tic-Tac-Toe 68Chapter 5 Creating Games with the Canvas Tag 71Getting Started with the Canvas 71Drawing Your First Paths 72Drawing Game Sprites for Tic-Tac-Toe 73Drawing Objects on the Canvas with Transformations 75Ordering Your Transformations 76Saving and Restoring the Canvas Drawing State 77Using Images with the Canvas 78Serving Images with Data URLs 78Serving Images with Spritesheets 78Drawing Images on the Canvas 78Animating Objects with Trident.js 79Creating Timelines 80Animating with Keyframes 81Creating Nonlinear Timelines with Easing 81Animating Game Objects with Spritesheets 83Simulating 3D in 2D Space 84Perspective Projection 84Parallaxing 85Creating a Parallax Effect with JavaScript 85Creating Copy Me 87Drawing Our Game Objects 87Making the Game Tones 88Playing MIDI Files in the Browser 89Playing Multiple Sounds at Once 90Playing Sounds Sequentially 91Drawing Our Game Text 91Styling Text with CSS Fonts 92Chapter 6 Creating Games with SVG and RaphaelJS 95Introduction to SVG 95First Steps with RaphaelJS 97Setting Up Our Development Environment 97Drawing the Game Board 98Drawing Game Text 99Custom Fonts 100Specifying Color 103Loading Game Assets 104Converting SVG Files to Bitmap Images 105Creating Our Game Classes 105Shuffling Cards 107Drawing and Animating Cards 107Creating Advanced Animations 110Paths 110moveto and lineto 110curveto 111Exporting Paths from an SVG File 112Animating Along Paths 113Extending Raphael with Plugins 113Adding Functions 113SVG Filters 113Speed Considerations 114Chapter 7 Creating Games with WebGL and Three.js 117Moving to Three Dimensions 118Giving Your Objects Some Swagger with Materials and Lighting 119Understanding Lighting 120Using Materials and Shaders 120Creating Your First Three.js Scene 122Setting Up the View 123Viewing the World 128Loading 3D Models with Three.js 129Programming Shaders and Textures 131Using Textures 134Creating a Game with Three.js 136Simulating the Real World with Game Physics 137Revisiting Particle Systems 140Creating Scenes 141Selecting Objects in a Scene 142Animating Models 142Sourcing 3D Models 143Benchmarking Your Games 144Checking Frame Rate with Stats.js 144Using the WebGL Inspector 145Chapter 8 Creating Games Without JavaScript 147Google Web Toolkit 147Understanding GWT Widgets and Layout 148Exposing JavaScript Libraries to GWT with JSNI 149RaphaelGWT 150Adding Sound with gwt-html5-media 151Accessing the Drawing APIs with GWT 151CoffeeScript 153Installing CoffeeScript 153Compiling CoffeeScript Files 153A Quick Guide to CoffeeScript 154Basics 154Functions and Invocation 154Aliases, Conditionals, and Loops 156Enhanced for Loop and Maps 156Classes and Inheritance 157Alternate Technologies 158Cappuccino 158Pyjamas 158Chapter 9 Building a Multiplayer Game Server 161Introduction to Node.js 161Extending Node with the Node Package Manager 162Managing Multiple Node Versions 162Making Web Apps Simpler with ExpressJS 163Serving Requests with URL Routing 163Managing Sessions 165Understanding the ExpressJS Application Structure 165Templating HTML with CoffeeKup 166Persisting Data with Caching 168Managing Client/Server Communication 169Communicating with Socket.IO 169Setting Up a Simple Socket.IO Application with Express 170Making Web Sockets Simpler with NowJS 171Debugging Node Applications 172Creating a Game Server 173Making the Game Lobby 173Creating Game Rooms with NowJS Groups 174Managing Game Participants and Moving Between Game Rooms 175Managing Game Play 175Chapter 10 Developing Mobile Games 179Choosing a Mobile Platform 179iOS 179Android 180WebOS 180Windows Phone 7 180Flick, Tap, and Swipe: A Quick Guide to Mobile Gestures 181Deciding Between an Application and a Website 181Storing Data on Mobile Devices 183Relaxing in Your Lawnchair: An Easier Way to Store Data 183Getting Started with Lawnchair 184Client-Side Scripting Simplified with JQuery and Zepto 185Using JQuery Variants 185Using Zepto.js 187Architecting Your Applications with JoApp 187Choosing an Application Framework 188PhoneGap 188Diving into the PhoneGap APIs 189Appcelerator Titanium 191Diving into the Appcelerator Titanium APIs 191Packaging Android Applications with Titanium and PhoneGap 191Packaging an Application with Titanium 193Packaging an Application with PhoneGap 195Chapter 11 Publishing Your Games 199Optimizing Your Game's Assets 199Minification with Google Closure Compiler 199Running Applications Offline with Application Cache 201Hosting Your Own Server 203Deploying Applications on Hosted Node.js Services 204Publishing Applications on the Chrome Web Store 205Describing Your Application's Metadata 206Deploying a Hosted Application 207Deploying a Packaged Application 208Testing Your Applications Locally 208Uploading Your Application to the Chrome Web Store 208Configuring Your Application 210Deciding Between Packaged and Hosted Chrome Apps 212Publishing Applications with TapJS 212Creating a TapJS Application 213Packaging an Application for TapJS 215Publishing a TapJS Application to Facebook 215Publishing Games with Kongregate 217Publishing HTML5 Applications to the Desktop 217Index 219