I’m fairly new to web development and Django so bear with me. I’m planning to make a fairly simple website in Django, that part I can manage.
I’m then looking to build a few basic 2d games into it, I fully appreciate that you can easily manage this in flash or as a java web app but I’m looking to implement them in python. I’ve done some research but I’m coming up blank, is there a straightforward way to create 2d python web games that would easily be integrated with django?
I’m hoping to build these games in Python so that the users can program their own individual AI’s for the game, again in Python, and compete against each other. As a bit of a competition/learning exercise.
Thanks in advance and sorry if it turns out to be a stupid question.
As browsers (everything except Grail) do not run python code it is fairly difficult to build the game you want in python. In theory you could mix some client side Javascript with some python code running on the server side, but that would not be a very goog idea, since the browser would have to communicate with the server for “every move in the game”. You can also have server side python rendering html, but that wouldn’t make a very good game.
You could try to make a gaming site for Grail users, but I suppose there aren’t many 🙂
More seriously:
You can also take a look at pyjs. And theres even a game example. You can find the source code for the asteroid game here. I can imagine that pyjs is pretty much all you have got to make it work.
Similar question to yours has been asked before, you should check the answers.