Python browser games: Possible or fantasy?

While working on some database stuff for my CMS I got stuck, so I asked for help. The problem is that at the time of posting it was like in the middle of the night in America. So I looked around on the forums if I could be of any help to someone.

Then I found this thread where someone asked if he could run his PyGame in a browser. I never wrote a game… well not a real one at least, but it sounded interesting. So this is how I spend this day, looking for magic ‘Python applets’

Add me to the list of people who would like to know about it ๐Ÿ˜›
After reading this I got myself a copy of Jython and tried some of my scripts(, falied) and made a nice swing gui with the interactive shell.

One thing I noticed is the lack of… A lot of stuff actually. ๐Ÿ˜ฆ
So step one is to get PyGame to run on Jython at all, if that works… convert to an applet.( http://www.jython.org/applets/ )

Could it be possible to make a Python implementation in actionscript?(Flash)
Interesting thought… But just fantasy I guess. ๐Ÿ™„

Did anyone here do but even the slightest research โ— โ“
PyGame on Jython is not even possible, so why bother thinking about PyGame applets?
It’s just not going to happen, unless someone writes a Python browser plugin.

Now THAT is another cool idea, but even more unlikely to happen then a flash implementation of Python.

I searched the whole interned and did not yet found a way to run PyGame in the browser.
The 3 closest are:

Jython, it does java applets, but no PyGame. Writing awt/swing games should be fine.
How about the other way around? Seek a light-weight Java game framework and import it into Jython. You can use java classes remember… Use them!( http://www.lwjgl.org/index.php )
It IS possible to do JNI from within a signed applet ๐Ÿ˜‰

Grail, the Python browser. It’s dead and old I think, but it had Python applet support.

I hate Microsoft and their wannabe Flash: SilverLight, but the seem to have produced something nice: Ruby and Python support! http://silverlight.net/learn/dynamiclanguages.aspx/
But then we arrive at the same point as Jython… PyGame!!! Silverlight uses IronPython ๐Ÿ˜ฆ
But there is light at the end of the tunnel, according to a blog post(which I lost), http://code.google.com/p/ironclad/ got as far as importing PyGame into IronPython. This does not mean it will run ๐Ÿ˜‰ ๐Ÿ˜ก

This is how much energy I’m going to put in it…
In the future it might be possible to write Jython or IronPython games using PyGame and Java/Silverlight. Or someone might write a Python browser plugin…
But at the moment there is no good/tested way of writing browser game with Python.


2 Responses to “Python browser games: Possible or fantasy?”

  1. August 3, 2009 at 2:13 am

    I’ve been looking for a way to run PyGame in the browser also.

    Recently I’ve taken a liking to Googles Native Client project (http://code.google.com/p/nativeclient/) which allows native C code to run in the browser.

    So far Native Client comes with SDL out of the box, and someone has ported Python to Native Client (http://lackingrhoticity.blogspot.com/2009/06/python-standard-library-in-native.html) just so far no one has ported PyGame to it so I’m playing the waiting game.

  2. August 3, 2009 at 2:19 am

    Also, I hate Microsoft too but trust me Silverlight is in no way a wannabe Flash.

    I’ve taken a liking to it, especially since it’s probably the first time Microsoft has supported making .NET applications for Mac and Linux and even the web (and in the future Symbian and Android).

    I’m hoping at least the .NET junkies will start porting their 2D games to Silverlight to increase their userbase.

Comments are currently closed.

My blog has moved!

My blog has permanently moved to a self hosted Wordpress at http://pepijndevos.nl

This blog will stay around for accidental search engine visitors.


This is me

Blog Stats

  • 22,895 hits



%d bloggers like this: