Web Browser Pygame Plug-in?

  • Thread starter =?ISO-8859-1?Q?Gregory_Pi=F1ero?=
  • Start date
?

=?ISO-8859-1?Q?Gregory_Pi=F1ero?=

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?
 
3

3KWA

Gregory said:
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
 
B

Ben Sizer

Gregory said:
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.
 
?

=?ISO-8859-1?Q?Gregory_Pi=F1ero?=

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?
 
B

Ben Sizer

Gregory said:
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.
 
R

Ravi Teja

Gregory said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top