16

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.

5
  • 20
    Plain Javascript plus a canvas tag on the page can go a really long way these days. There are quite a few games already implemented this way.
    – Alejandro
    Mar 15 at 19:39
  • 4
    ^ Second that. Flash Player is ended because Javascript does everything it did better now. Between JS, the HTML5 canvas, and modern WebGL support in browsers, you're set. And if you need even better performance, you can dip into WASM, which is supported in all major browsers today. Mar 16 at 17:40
  • 2
    You can just continue using Flash with ruffle.rs
    – emanresu A
    Mar 17 at 1:08
  • 2
    @SilvioMayolo I take exception to your claim that “JavaScript does everything better”.
    – Dai
    Mar 17 at 17:06
  • @emanresuA That "Fly Guy" demo game was actually kinda fun. Although performance was horrible, sometimes speeding up the clocking or slowing down in extremes (becoming choppy)... and then Ruffle completely crashed my computer. In that sense I would say it offered a very authentic Flash experience. (Time travel was neat, but I'll be returning to 2022 now.)
    – Mentalist
    Mar 18 at 14:46

7 Answers 7

9

Wick Editor can be used as a free alternative to Adobe Animate (formely named Flash Professional).

Similiarities and differences to/from Animate:

  • The editor itself doesn't have the "pen" tool, so to draw curves indirectly you use the line tool, then hover the line with the mouse pointer using Path Cursor tool and curve it.

Screenshot of Wick Editor toolbar

  • Like Animate, timeline can have code (instead of ActionScript, it is JavaScript).

Other information:

  • If you want NPM (Node.js Package Manager) dependencies, then you'll want to explicitly use the .wick runtime from a NPM project. Currently the .wick runtime is not available on NPM, so it means it must be extracted from an archive export from the Wick Editor.

These posts might help you with the .wick runtime:

6

Expanding on Alejandro's comment you could try p5js.

p5.js is a JavaScript library for creative coding, with a focus on making coding accessible and inclusive for artists, designers, educators, beginners, and anyone else!

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!))

4
  • Just had a quick look at their implementation of snake and I wonder how they can say they focus on making coding inclusive for artists and etc.? No artist nor beginner will understand much of it.
    – Shautieh
    Mar 16 at 10:40
  • The maths get a little complex (but that's true of anything that requires movement). That level of javascript could be picked up in a matter of hours though. Here is an example with no movement so you can see how quickly/simply you can get basic things up and running. editor.p5js.org/p5/sketches/Hello_P5:_interactivity
    – Sam Dean
    Mar 16 at 10:58
  • I've just updated the tutorial playlist to a better one. It's about 4 hours long and after going through it you hopefully wouldn't have any issues with that snake code.
    – Sam Dean
    Mar 16 at 11:03
  • 1
    @Shautieh It only looks that way from the perspective of someone with no understanding of JS. A majority of the complexity is the math, but that’s not really different from what it would be in an equivalent implementation in Flash. The actual JS is at a level that can be picked up in less than a day by someone who already has basic coding experience (which I would assume to be the case for anybody using Flash). Mar 16 at 13:54
6

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?

5

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.

2

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.

2

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.

When you do not want to use JS, but something more portable (Scheme, …) or compilable to machine code (C, C++, Rust, … – see also Emscripten project), you can choose some transpiler or compiler that produces either WebAssembly (bytecode supported by the most common browsers) or asm.js (assembly-like form of JavaScript, supported everywhere where the JS is).

So, the solution is simple: Modern web standards are enough for such purposes.

1

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.

Everything else is going to be HTML5, probably backed up with a canvas element. You can use plain javascript or one of the very many js libraries designed for this sort of thing. The first 3 I can think of which aren't already in another answer are phaser, melon and createjs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.