Create particle effect with Rust WASM & HTML Canvas

The previous post was a step-by-step tutorial on how to use wasm using Rust and run it in a browser. We built a simple web page with only an input field and a button. In this post, we will make something more interesting by creating a particle system in which 1000 randomly colored particles move in random directions at varying speeds. We will draw particles on HTML Canvas with all the logic done using the Rust wasm module.

How to fix IntelliSense canvas context problem in Visual Studio

When coding in JavaScript, I prefer using Visual Studio IDE due to its JavaScript IntelliSense and debugging capabilities. But recently, when I started to experiment with canvas, I noticed something strange. As you might know, to draw and manipulate graphics on the canvas element, you first need to get the canvas context. In some instances, the IntelliSense is not working on canvas context and as a result, the list of suggestions is missing all the context methods and properties you would expect. This article will show how to fix that.

Canvas : How to create a simple particle system in 50 lines

Recently I started to learn how to use canvas HTML5 element and the first thing I tried to do was to draw a small rectangle. Next, I wanted to an add animation loop and move that shape. After that worked, I wanted to add a bunch of them all moving in different directions and this is how my first particle system was born. This article will show you how to create one yourself. The particle system is a pretty basic one. Each particle gets a random color, random direction, and random speed when they are created. After they reach the edge of the canvas, they will bounce off of it.