Every web platform answer, on this machine.
The Mozilla Developer Network corpus, mirrored and indexed locally: 14,753 reference pages, full-text search that works offline, and notebooks that execute each example in a sandboxed frame.
Browse
Start reading
2D breakout game using Phaser
Games/Tutorials/2DbreakoutgamePhaser/Initializetheframework
2D breakout game using pure JavaScript
Games/Tutorials/2DbreakoutgamepureJavaScript/Initializethecanvas
2D collision detection
Algorithms to detect collision in 2D games depend on the type of shapes that can collide (e.g., Rectangle to Rectangle, Rectangle to Circle, Circle to Circle). Generally you will have a simple generic shape that covers the entity known as a "hitbox" so even though collision may not be pixel perfect, it will look good enough and be performant across multiple entities. This article provides a review
2D maze game with device orientation
In this tutorial we'll go through the process of building an HTML mobile game that uses the Device Orientation and Vibration APIs to enhance the gameplay and is built using the Phaser framework. Basic JavaScript knowledge is recommended to get the most from this tutorial.
3D collision detection
This article provides an introduction to the different bounding volume techniques used to implement collision detection in 3D environments. Followup articles will cover implementations in specific 3D libraries.
3D games on the Web
For rich gaming experiences on the web, the weapon of choice is WebGL, which is rendered on HTML canvas. WebGL is basically an OpenGL ES 2.0 for the Web — it's a JavaScript API providing tools to build rich interactive animations and of course, also games. You can generate and render dynamic 3D graphics with JavaScript that is hardware accelerated.
A perspective retrospective for WebXR developers
WebXR Device API