Book Image

Learn HTML5 by Creating Fun Games

By : Rodrigo Silveira
Book Image

Learn HTML5 by Creating Fun Games

By: Rodrigo Silveira

Overview of this book

HTML is fast, secure, responsive, interactive, and stunningly beautiful. It lets you target the largest number of devices and browsers with the least amount of effort. Working with the latest technologies is always fun and with a rapidly growing mobile market, it is a new and exciting place to be."Learn HTML5 by Creating Fun Games" takes you through the journey of learning HTML5 right from setting up the environment to creating fully-functional games. It will help you explore the basics while you work through the whole book with the completion of each game."Learn HTML5 by Creating Fun Games" takes a very friendly approach to teaching fun, silly games for the purpose of giving you a thorough grounding in HTML5. The book has only as much theory as it has to, often in tip boxes, with most of the information explaining how to create HTML5 canvas games. You will be assisted with lots of simple steps with screenshots building towards silly but addictive games.The book introduces you to HTML5 by helping you understand the setup and the underlying environment. As you start building your first game that is a typography game, you understand the significance of elements used in game development such as input types, web forms, and so on.We will see how to write a modern browser-compatible code while creating a basic Jelly Wobbling Game. Each game introduces you to an advanced topic such as vector graphics, native audio manipulation, and dragging-and-dropping. In the later section of the book, you will see yourself developing the famous snake game using requestAnimationFrame along with the canvas API, and enhancing it further with web messaging, web storage, and local storage. The last game of this book, a 2D Space shooter game, will then help you understand mobile design considerations.
Table of Contents (14 chapters)

WebGL


Perhaps no other HTML5 feature is as exciting for game developers as WebGL. This new JavaScript API allows us to render high performance, hardware accelerated 2D and 3D graphics. The API is a flavor of OpenGL ES 2.0 and makes use of the HTML5 canvas element in order to bridge the gap between the browser and the graphics processing unit in the user's computer.

While 3D programming is a topic worthy of its own book, the following overview is sufficient to get us started on the most important concepts, and will allow us to get started with 3D game development for the browser platform. For those looking for a good learning resource for OpenGL ES 2, take a look at OpenGL ES 2.0 Programming Guide by Munshi, Ginsburg, and Shreiner.

Note

Since WebGL is heavily based on OpenGL ES 2.0, you may be tempted to look for reference and supplemental material about it from OpenGL books and other sources. Keep in mind that OpenGL Version 1.5 and earlier is significantly different than OpenGL 2.0 (as well...