Making a 2d browser Game

Started by
9 comments, last by Kryzon 9 years, 7 months ago

This is my first time posting on this forum, so sorry if I am posting in the wrong section. I want to make a 2d multiplayer browser shooter, but am not sure if which languages to do it in. I was thinking of using Angular JS for client side, and PHP for back end. I am still learning those languages and don't know much yet, but I was hoping for some confirmation or a better suggestion in the languages I should use.

Advertisement
I would suggest (and im sure many others would too) using HTML5 client-side, and nodejs for the backend. That way everything is in the same language (which should allow for smoother integration between the two). With that said I suggest you use the socket.io library for networking. Its pretty simple to use and is an awesome library! Also.. welcome to the forums! I think you'll like it here :)

Thanks for the quick reply :) . You've been very helpful

HTML5 front end and node seconded.

Be aware that you need to have quite a bit of IT knowledge to get Node.js and Socket.io to operate correctly on your server.

If you choose remote hosting service , Node.js & Socket.io are either poorly supported or complicated to set up .

I cannot remember the books I've read any more than the meals I have eaten; even so, they have made me.

~ Ralph Waldo Emerson

It might be complicated, but I'm willing to learn :)

Have you tried using an HTML5 game engine like Construct2? Its great if you don't wanna write a lot of client side code.

I find that using Emscripten C++ for the frontend and Emscripten C++ for the backend has been very successful. Emscripten for the backend uses node.js at runtime so ensures that when serving sockets using the traditional BSD sockets API, you infact serve websockets instead.

http://kripken.github.io/emscripten-site

Coupled with static typing and RAII of C++ and portability to all platforms in existence, it is proving to be a really great solution for games. So good infact that even commercial products like Unreal and amateur / hobby game engines like Unity are starting to use it as their backends.
http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.
I second the choice of Node on the back end for your project.

Myself, I've opted for python on the back end for two reasons: I favor the python language, and ctypes makes it very easy to use C++ (using a c api to python) when python isn't fast enough. Care must be taken to keep the overhead of crossing the ctypes boundary low, so most native functions process data in batches.

I've used python with the pygame module to make a tower defence game once. is python really a better choice for a backend than node js?

This topic is closed to new replies.

Advertisement