By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,490 Members | 1,489 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,490 IT Pros & Developers. It's quick & easy.

Web Browser Pygame Plug-in?

P: n/a
Hi guys,

I was just idley curious on what it would take to make a web plug-in
for Pygame. I'm picturing it working the way my browser currently
shows flash games. Is such an idea even possible? Has anyone
attempted this?

--
Gregory Piñero
Chief Innovation Officer
Blended Technologies
(www.blendedtechnologies.com)
Jul 6 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Gregory Piñero wrote:
I was just idley curious on what it would take to make a web plug-in
for Pygame. I'm picturing it working the way my browser currently
shows flash games. Is such an idea even possible? Has anyone
attempted this?
Not a plugin but at Europython the PyPy crew presented the Javascript
backend of PyPy which transforms-converts a python program into a
Javascript application (not sure I understood it all so ...). They
showed us a Javascript version of the Bub-n-Bros game (written using
pyGame). Pretty cool is you ask me.

EuGeNe

Jul 6 '06 #2

P: n/a
Gregory Piñero wrote:
I was just idley curious on what it would take to make a web plug-in
for Pygame. I'm picturing it working the way my browser currently
shows flash games. Is such an idea even possible? Has anyone
attempted this?
I doubt you can get PyGame to work this way - at least, not without
some significant hacking around in the source - since PyGame relies on
the underlying SDL library, and from my experience with it, I can't see
it playing well with a browser whatsoever. I think SDL would have to
acquire a new backend to translate input to the plugin into their event
structure, and would require some way of creating an appropriate video
mode that can draw to a browser's window, etc. Java applets and Flash
are built for this purpose whereas PyGame is built on a technology that
was designed for programs that have their own window and tend to
capture all the OS's input.

--
Ben Sizer

Jul 10 '06 #3

P: n/a
That's interesting, Ben. So we'd be better off making a new library
similiar to Pygame in functionality but designed from the ground up to
work in a browser. I guess that XPCOM technology that someone
mentioned might be the way to go?
On 10 Jul 2006 03:54:33 -0700, Ben Sizer <ky*****@gmail.comwrote:
Gregory Piñero wrote:
I was just idley curious on what it would take to make a web plug-in
for Pygame. I'm picturing it working the way my browser currently
shows flash games. Is such an idea even possible? Has anyone
attempted this?

I doubt you can get PyGame to work this way - at least, not without
some significant hacking around in the source - since PyGame relies on
the underlying SDL library, and from my experience with it, I can't see
it playing well with a browser whatsoever. I think SDL would have to
acquire a new backend to translate input to the plugin into their event
structure, and would require some way of creating an appropriate video
mode that can draw to a browser's window, etc. Java applets and Flash
are built for this purpose whereas PyGame is built on a technology that
was designed for programs that have their own window and tend to
capture all the OS's input.

--
Ben Sizer

--
http://mail.python.org/mailman/listinfo/python-list

--
Gregory Piñero
Chief Innovation Officer
Blended Technologies
(www.blendedtechnologies.com)
Jul 10 '06 #4

P: n/a
Gregory Piñero wrote:
That's interesting, Ben. So we'd be better off making a new library
similiar to Pygame in functionality but designed from the ground up to
work in a browser.
I think it depends on what is most important to you. Options available
include going with Java or Flash instead (ie. dropping Python), or
using a Jython applet (which I know nothing about), or perhaps
abandoning the browser and sticking with PyGame, etc. What are your
requirements?
I guess that XPCOM technology that someone
mentioned might be the way to go?
I was under the impression that XPCOM was a Mozilla-only technology; if
so, maybe that won't fit your requirements either.

--
Ben Sizer

Jul 10 '06 #5

P: n/a
Gregory Piñero wrote:
That's interesting, Ben. So we'd be better off making a new library
similiar to Pygame in functionality but designed from the ground up to
work in a browser.
In open source community, that would be YOU since you are the one with
the need :-). Maybe you can make "Python WebStart".

Running foreign native code from a browser has long been abandoned as a
bad idea since ActiveX spyware proliferation (which BTW, is another way
to package your game as. Although that would effectively restrict it to
IE just like XPCOM would restrict it to Mozilla family). Plus your
users will have to download Python somehow (Python is not as widespread
as Java or Flash on consumer desktops), either as part of the game or
independently. And finally, if PyGame was written in pure Python
without taking advantage of SDL to be fully cross-platform, it would
likely not be fast anymore. It better be a REALLY great game to go with
all these issues :-).
I guess that XPCOM technology that someone
mentioned might be the way to go?
It is far simpler to just use Jython and some Java Game library instead
of PyGame if browser delivery is that important to you.

Jul 10 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.