O'Reilly logo

Programming WebAssembly with Rust by Kevin Hoffman

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

Building the WARoS Match Engine

The WARoS match engine will be responsible for the following:

  • Provide a host runtime for each WebAssembly module
  • Provide a game loop for moving the match forward
  • Manage game state
  • Complete a match after a given number of cycles

Building a game engine is no small feat. The goal of what we’re building in this chapter isn’t to produce the best game engine. It’s to illustrate how we can host multiple WebAssembly modules simultaneously within a virtual environment and allow their logic to safely interact and manipulate shared state. In the following sections, you’ll see how to accomplish all of this with Rust.

Threading, Time Slicing, and the Game Loop

Building games and game engines is loads of fun for certain types ...

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

Start Free Trial

No credit card required