Skip to main content

WASM Bevy Canvas

This experiment was written to test out using Bevy on the web. It was intentionally kept simple to focus on the basics of rendering simple shapes with Bevy and deploying the code to the web -- particularly deploying within the content of another app (in this case Docusaurus).

The application starts up Bevy, adds 1000 random circles with varying positions, sizes, and colors, and then updates them to slowly move around and bounce against the "walls" of the container.

The Bevy application is passed the ID of the hosting canvas element rather than running fullscreen which it then uses to determine the rendering size.

The source code is available here.