473,837 Members | 1,407 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Web Browser Pygame Plug-in?

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
5 3934
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2823
by: AnsNum | last post by:
hello, when I start this program, the movie doesn't play smoothly, anybody has an idea ? (I use windowsXP) import pygame from pygame.display import flip from pygame.locals import * pygame.init()
5
3115
by: Andrea Griffini | last post by:
Just a quick shoot... can I produce a "closed source" program using "core" python, pygame (and eventually psyco), packaging it by using py2exe and a custom installer ? A clear yes/no answer is something I'll be asked about when proposing python as an interesting alternative. If the answer is "no" (as I fear) what's the minimum of "opening" that must be done ?
12
16165
by: Marian Aldenhövel | last post by:
Hi, I am trying to make pygame play music on windows. This simple program: import pygame,time pygame.init() print "Mixer settings", pygame.mixer.get_init() print "Mixer channels", pygame.mixer.get_num_channels() pygame.mixer.music.set_volume(1.0) pygame.mixer.music.load('file1.mp3)
1
1430
by: joshuabraham | last post by:
os version =windows xp hi guys i'm having problems using pygame the following code just does not seem to work. clock=pygame.time.Clock() while True: sound1.play() clock.tick(60) pKeys = pygame.key.get_pressed() Eves=pygame.event.get() villian.face() villian.hert()
5
4220
by: globalrev | last post by:
if pygame.key.get_pressed: print "Muppet" K_a is not defined. but yes it is. why do i get this error? this works: if pygame.key.get_pressed():
0
9843
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9682
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10875
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10623
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9401
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7806
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7001
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5848
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3124
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.