pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
sPyGame

sPyGame - 0.0.5

Magnie Mozios (magnie)

Tags:

Description

sPygame ( Simple Pygame ) is a simplified version of Pygame ( Obviously. ^.^ ) I am currently having trouble making it so you can detect if a key is being pressed... so it doesn't do much yet. ( All you can really do is make animations or something like the so. ) Currently the Quit() function does not work fully. ( Just sys.exit(0) )

Links

Home Page: http://playfultest.uni.cc/
Source: http://playfultest.uni.cc/Non%20Major%20Projects/spg.py

Releases

sPyGame - 0.0.5 - Mar 26, 2010

Pygame.org account Comments

If you wish to leave a comment with your pygame.org account, please sign in first.

May 3, 2010 1:02pm - Steven Bluen - nickname: (sbluen)
exec doesn't work like that. exec can only be used as a statement by itself. The if statement must go inside the quotes as part of the statement to execute, or can be used with the effects of the statement. So you can do this.

exec "temp = 'pygame.' + key"
or
exec "if 'pygame.' + key: return 'pygame' + key"
or a third way with a different type of statement
exec "return ('pygame' + key if 'pygame' + key else None)"
But then you must make sure that you check for a typeError.
April 13, 2010 11:23am - Magnie Mozios - nickname: (magnie)
Now the question is... How do I get true or false from the exec command? I also get an error with using exec 'return' with anything and I can't do:

if exec "pygame." + key:

or

temp = exec "pygame." + key
if temp:

... :/
April 4, 2010 1:44pm - Steven Bluen - nickname: (sbluen)
Yeah, though there are many similar ways to do that. One way is this.
if string is in dir(pygame):
exec "return 'pygame.' + string"
March 30, 2010 11:39am - Magnie Mozios - nickname: (magnie)
So, I'll won't be able to do something like:

variable = K_RETURN

pygame.variable

?

Thought so... oh well. Thanks! Now I know for the future. xD
March 30, 2010 1:03am - Steven Bluen - nickname: (sbluen)
Your program compares strings to events. Events are never strings or equal to strings to my knowledge.
March 30, 2010 12:54am - Steven Bluen - nickname: (sbluen)
For Key_pressed(key) you might want to have a look at http://www.pygame.org/docs/ref/event.html and find out what keyboard events really are.
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Sep 9, 2014

Sep 8, 2014

Sep 7, 2014


Sep 5, 2014

Aug 26, 2014

Aug 22, 2014

Aug 21, 2014


Aug 18, 2014

Aug 2, 2014


... more!
 
for pygame related questions, comments, and suggestions, please see help (lists, irc)