20 AnswersNew Answer
I can see from your profile that you have completed a large number of courses, congratulations. You may wish to take a look at the Phaser game engine which uses web technologies. https://phaser.io/ Another option is to use a game development system such as CopperCube which targets desktop systems, Android, and browsers. https://www.ambiera.com/coppercube/index.html
Cryphean If I'm correct, one can make browser games using C++. You can use web assembly.
SFML will not work in a browser. You will need to use WebGL in a browser.
I found Godot is great option which allows me to export games also into html5 too
🌀 Shail Murtaza شعیل مرتضیٰ yes true. But it's not C++ anymore, instead, as I said, converted binary code from a compiler like enscripten.
Mehran actually I changed my mind, I probably learn WEBGL instead of sfml
Martin Taylor I am recently posting games on sololearn in vanilla js, but I started with c++ and found this amazing library, Btw I never used any game libraries, cause html canvas is enough, but I saw games made in unity playable in browser so I thought this could be possible too... Okay thanks for answers, I check the coppercube, it looks interesting
Use. " iframe"
I've heard that c++ code can be converted to WebAssembly code, but I don't think it's possible to do that with sfml.
David Dolejší You can write your code in c++ then compile it it wasm code which you can attach to the html file to work.
David Dolejší I have used godot game engine. It's simple, easy to use and good game engine. Your Web Game will be exported in Web Assembly. You can export your game for android, windows, linux and other platforms using Godot which really is great. It has not many features as compared to game engines like unity and unreal. That's why it is very light weight too.
can you show where to get it?
David Dolejší here: https://emscripten.org But as Martin Taylor already mentioned, SFLM cannot be converted into the web, so this will probably not be useful for you.
Shardul Narawade but still how can I upload the game on another website
David Dolejší Yes, webgl is the main way to do this.
The old way was with ActiveX, and you can always create a new browser that runs C flavored code with interpretation, or compiled binaries. A good argument is file sizes and reduced requests. Can you elaborate on the project?