I wonder since Flash Player ended, what can replace it to make a game in 2D on a website?
I would like preferably something free and which doesn't require to be installed by clients/users.
Software Recommendations Stack Exchange is a question and answer site for people seeking specific software recommendations. It only takes a minute to sign up.Sign up to join this community
Wick Editor can be used as a free alternative to Adobe Animate (formely named Flash Professional).
Similiarities and differences to/from Animate:
These posts might help you with the .wick runtime:
Expanding on Alejandro's comment you could try p5js.
Here is an implementation of snake in their online editor. (Use i,j,k,l to control the snake).
The Coding Train on YouTube has lots of video tutorials on p5js (and processing, what p5js is based on (I think!))
Modern standard web technologies seem to be reasonably powerful to reproduce what you once did with Flash Player. What about https://rive.app/ for example?
Godot Engine is an open-source game engine and IDE that can produce games that run on multiple platforms, including the web. For the latter, it produces a WASM (WebAssembly) package that you can integrate with a few lines of HTML/JS into any web page.
Here's an example of a 2D game written in Godot, playable in the browser: Wurst Day Ever.
The excellent OpenFL library https://www.openfl.org/ uses many of the same APIs as Actionscript 3.0; even the Haxe programming language used in OpenFL is quite similar in syntax/grammar to Actionscript 3.0. OpenFL is made with portability in mind, so native and HTML5 build targets are available out of the box.
All the answers that were posted there ignore that we have OpenGL-like API (WebGL), 2D graphics (canvas and SVG) and transpilers (something→JS) for many programming languages, and even binary executables (wasm). You can use these technologies to develop games for web browsers and all of these are standard technologies and well-supported by current browsers.
You can develop the game in pure JS with drawing onto canvas with the ordinary 2D commands (for rather simple graphics). If you want 3D or just more complex graphics, you can use WebGL.
So, the solution is simple: Modern web standards are enough for such purposes.
The Unity web player still works, though it's no longer supported and requires the user to install it.
Supernova flash player is an option for legacy swf files.