Skip to product information
1 of 1

Explore WebAssembly programming with JavaScript and HTML for building native-like games and applications for browsers

Key Features

  • Build a WebAssembly game exploring core game development concepts such as animations, physics, and particle systems
  • Get to grips with advanced game mechanics in WebAssembly
  • Learn how to use WebAssembly and WebGL to render the HTML5 canvas element

Book Description

WebAssembly (also called Wasm) is an exciting new technology that brings native-like speed and performance to web applications. Game development typically requires high performance and WebAssembly can deliver just that using native languages such as C/C++, JavaScript, and Rust.

This game development book will introduce you to the world of WebAssembly by taking you through the development of a retro arcade game. You'll learn how to build a WebAssembly application using C++, Emscripten, JavaScript, and HTML5. This book covers ground in both game development and web application development, helping you get to grips with various frameworks and libraries. You'll get to grips with building animations, designing UI, managing game physics and sound effects, and develop many other skills necessary for game and app development. Additionally, you'll work with tools such as Emscripten, WebGL, and OpenGL to build a complete browser-based game with advanced shaders, debugging, and optimization capabilities.

By the end of the book, you'll be able to create and deploy simple browser games and web applications using WebAssembly.

What you will learn

  • Build web applications with near-native performance using WebAssembly
  • Discover how to use web applications to create games using HTML5 Canvas, WebGL, and SDL
  • Study game development concepts such as sprites, camera design, sound effects, and AI
  • Deploy C/C++ applications to the browser using WebAssembly and Emscripten
  • Understand how Emscripten HTML shell templates, JavaScript glue code, and a WebAssembly module interact
  • Debug and performance-tune your WebAssembly application

Who this book is for

This book is for developers who want to build apps and games for the web using WebAssembly. If you're a game developer looking to deploy your games to the web or a web developer interested in exploring WebAssembly along with JavaScript web, you'll find this book useful. The book will also help C/C++ developers to enhance their web development skills. Working knowledge of web development is required.

Table of Contents

  1. Introduction to WebAssembly and Emscripten
  2. HTML5 and WebAssembly
  3. Introduction to WebGL
  4. Sprite Animations in WebAssembly with SDL
  5. Keyboard Input
  6. Game Objects and the Game Loop
  7. Collision Detection
  8. Basic Particle System
  9. Improved Particle Systems
  10. AI and Steering Behaviors
  11. Designing a 2D Camera
  12. Sound FX
  13. Game Physics
  14. UI and Mouse Input
  15. Shaders and 2D Lighting
  16. Debugging and Optimization
View full details