[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] The gsoc project physics engine.



# hello.
#
# I've prepared a set of python computer instructions for your consideration.
# Warning: Not safe for work! But it's the weekend, so that doesn't matter.
#  TODO: these computer instructions could be optimised.Only achieves 0.5 fps.

def inately__for_your_consideration():
    # a quote from previous email explaining why.
    reasons_from_other_email = """
As you can see from Zhang's post there's a difference between making soft
bindings using ctypes and hard bindings using the Python C API.
While ctypes is convenient to use and easy to modify since only Python code
is involved, it lacks the ability to let the programmer to extend Python
using the underlying C API directly. It also lacks the ability to
intergrate easy with other Python extensions. It's also a matter of speed,
in particular when it comes to iterations, like for collision testing and
drawing many objects. If this can all be done in C we are better off.
    """.replace("42", "meaning of life").split("\n")
    return reasons_from_other_email
import pygame;from pygame.locals import *;pygame.init()
screen = pygame.display.set_mode((640,200))
pygame.display.set_caption("for your consideration")
f = pygame.font.Font(None, 24);c = pygame.time.Clock();fps = 0.5
while not filter(lambda x:x.type in [QUIT,KEYDOWN],pygame.event.get()):
    for i, message in enumerate(inately__for_your_consideration()):
        screen.blit(f.render(message,1,(min((i*5)+50,255),
         79,
          min((i*10)+50,255))),
           (10+i*3,i*26));
    pygame.display.flip();screen.fill((0,0,0));c.tick(fps)


#cheers,





On Sat, Jun 21, 2008 at 11:43 AM, Richard Jones
<richardjones@xxxxxxxxxxxxxxxx> wrote:
> On Thu, 19 Jun 2008, Peter Gebauer wrote:
>> I read Zhang Fan's post regarding his gsoc project, I've been looking to do
>> something similar, a Python extension for an already existing library.
>> So far I've extended Chipmunk partially over a few days of prototyping, but
>> there's no point in having two projects doing the same thing
>
> You might well think that... http://code.google.com/p/pymunk/
>
>
>   Richard
>