Re: [pygame] fun game

2007-04-23 Thread adam naples

you're on a G4?
break out the velocity engine on that fun.

On Apr 23, 2007, at 6:45 PM, James Paige wrote:

I am working on a really fun game, but I am having a hard time  
making it

more fun. I need some help. Here is the source code so far:

#
print Preparing to do fun things...
import math
import random

print Commencing fun...
while True:
  math.sqrt(random.random())
#

The trouble is, when I check my processor usage on my dual  
processor Mac

G4, I only have one processor averaging around 90% fun, and sometimes
dropping as low as 86% fun. Does anybody know a more fun operation  
than
math.sqrt that I could use to push the fun up to 100%? Is there any  
way

I am going to be able to get both processors up to 100% without using
multithreading? I figure I should be able to max out at 200% fun on  
this

system, but I am stuck here. Any advice?

---
James Paige


The information contained in this message may be privileged and  
confidential. If you are NOT the intended recipient, please notify  
the sender immediately with a copy to [EMAIL PROTECTED] and  
destroy this message.


Please be aware that email communication can be intercepted in  
transmission or misdirected. Your use of email to communicate  
protected health information to us indicates that you acknowledge and  
accept the possible risks associated with such communication. Please  
consider communicating any sensitive information by telephone, fax or  
mail. If you do not wish to have your information sent by email,  
please contact the sender immediately.






Re: [pygame] Wii Remote support -- first patch

2006-12-17 Thread adam naples
this looks great, I've been meaning to get this running for my  
research, but I'm swamped until after the holidays.

I'd be happy to help/submit some samples etc.

-an

On Dec 17, 2006, at 9:36 AM, robomancer wrote:


Hi all,

I've created a first step toward Wii Remote support in Pygame.  Patch
is against 0.7.1 because the current SVN doesn't build for me.  I
expect that future patches will be against SVN head, or 0.8 when that
is released.  Let me know what you think.  You can download the
current sample code here:

http://gs3080.sp.cs.cmu.edu/wiimote/

Here's the README file:

Preliminary Wii Remote support for Pygame.  This is definitely
proof-of-concept code, and is only likely to work in Linux.  The only
supported features are: discovering Wiimotes via Bluetooth, polling
the buttons and 3-axis force vector, and setting the LEDs.  The
wiimote.py module has useful docstrings for all public functions, so
pydoc pygame.wiimote should give you some helpful documentation once
it's installed.  You can also just look at the LiiPong sample code.

Files in this package:

liipong-0.1.py

Pong for Linux with the Wii Remote.  See the top of liipong-0.1.py for
some setup instructions.  You can play 1-player or 2-player!  To play
2-player, just sync 2 Wii Remotes when the game prompts you to.

pygame-0.7.1-wiimote1.patch

Patch to Pygame 0.7.1 that enables preliminary Wii Remote support.
I'll generate a new patch against Pygame 0.8 when that comes out (for
now, the SVN isn't building for me; I seem to need a new version of
SDL, which I'm too lazy to compile from scratch at the moment).

__init__.py, locals.py, wiimote.py

Full versions of the Pygame 0.7.1 files I changed to enable Wiimote
support.  If you don't want to use the patch program, you can just
drop these in to the lib/ directory of the Pygame-0.7.1 source
distribution.

robomancer