[pygame] backup gsoc mentors?

2009-04-07 Thread René Dudfield
Hello,

is anyone interested in being a backup mentor for gsoc?

If so, please reply to this thread.

cheers,


Re: [pygame] backup gsoc mentors?

2009-04-07 Thread Toni Alatalo

René Dudfield kirjoitti:

is anyone interested in being a backup mentor for gsoc?


I am.

Am a 'gsoc winner' from the 1st year myself (worked with ipython 
notebook stuff under the PF umbrella), have used pygame professionally 
for many years but mostly just *using* it and not touching the c-written 
internals though. I have quite good experience with the py c api from 
working with the Blender API code though and have written pure c stuff  
(little games) long ago .. and am currently working pretty much full 
time with the py c/c++ api in http://www.realxtend.org/ new viewer 
project (in an embedded context within a c++ framework with Ogre so 
quite different stuff but the py c/c++ api is still the same)


Have sent some little patches to pygame long ago and read the internals 
then so would feel pretty ok at this .. am also used to reviewing other 
peoples code ;) .. so being a backup should be ok.


~Toni



Re: [pygame] backup gsoc mentors?

2009-04-07 Thread René Dudfield
Cool.  I've emailed you some details on a mailing list to sign up on, and
forwarded your email to the other pygame mentors.

cheers!


On Tue, Apr 7, 2009 at 6:19 PM, Toni Alatalo ant...@kyperjokki.fi wrote:

 René Dudfield kirjoitti:

 is anyone interested in being a backup mentor for gsoc?


 I am.

 Am a 'gsoc winner' from the 1st year myself (worked with ipython notebook
 stuff under the PF umbrella), have used pygame professionally for many years
 but mostly just *using* it and not touching the c-written internals though.
 I have quite good experience with the py c api from working with the Blender
 API code though and have written pure c stuff  (little games) long ago ..
 and am currently working pretty much full time with the py c/c++ api in
 http://www.realxtend.org/ new viewer project (in an embedded context
 within a c++ framework with Ogre so quite different stuff but the py c/c++
 api is still the same)

 Have sent some little patches to pygame long ago and read the internals
 then so would feel pretty ok at this .. am also used to reviewing other
 peoples code ;) .. so being a backup should be ok.

 ~Toni




[pygame] py2exe oceangui problem

2009-04-07 Thread David Gustafson
I'm having a problem and I wonder if anyone has any insight.  I have a
program that works runs properly but when I use py2exe to create an
executable and then attempt to run that executable from the dist dir I
get:

D:\code\test\disttwisted_ocean_client.exe
D:\code\test\dist\library.zip\twisted\spread\pb.py:30:
DeprecationWarning: the md5 module is deprecated; use hashlib instead
D:\code\test\dist\library.zip\ocempgui\draw\String.py:71:
RuntimeWarning: use font: DLL load failed: The specified module could
not be found
.
Traceback (most recent call last):
  File twisted_ocean_client.py, line 279, in module
  File twisted_ocean_client.py, line 227, in __init__
  File twisted_ocean_client.py, line 239, in drawButton
  File ocempgui\widgets\Button.pyc, line 83, in __init__
  File ocempgui\widgets\Button.pyc, line 97, in set_text
  File ocempgui\widgets\Label.pyc, line 124, in __init__
  File ocempgui\widgets\Label.pyc, line 158, in set_text
  File ocempgui\widgets\BaseWidget.pyc, line 961, in lambda
  File ocempgui\widgets\BaseWidget.pyc, line 527, in set_dirty
  File ocempgui\widgets\BaseWidget.pyc, line 875, in update
  File ocempgui\widgets\BaseWidget.pyc, line 792, in draw
  File ocempgui\widgets\Label.pyc, line 318, in draw_bg
  File D:\Python26\share\ocempgui\themes\default\DefaultEngine.py,
line 682, in draw_label
rtext = self.draw_string (label.text, label.state, cls, st)
  File D:\Python26\share\ocempgui\themes\default\DefaultEngine.py,
line 287, in draw_string
return String.draw_string (text, name, size, alias, color, st)
  File ocempgui\draw\String.pyc, line 169, in draw_string
  File ocempgui\draw\String.pyc, line 135, in create_font
  File ocempgui\draw\String.pyc, line 71, in create_file_font
  File pygame\__init__.pyc, line 70, in __getattr__
NotImplementedError: font module not available

D:\code\test\dist


Here is the code it is compiling and I can run it directly with python.
--


import pygame
import sys
from pygame import QUIT, event
from pygame import error as PygameError
from pygame import time as PygameTime

from random import randint

from ocempgui.widgets import *
from ocempgui.widgets.Constants import *
from ocempgui.object import BaseObject

from ocempgui.widgets import Button, Renderer
from twisted.internet._threadedselect import install
install()
from twisted.spread import pb
from twisted.internet import reactor

REPORT = pygame.locals.USEREVENT + 4
SCORE = pygame.locals.USEREVENT + 5

def main_loop():
events = pygame.event.get ()
for ev in events:
if ev.type == pygame.QUIT:
sys.exit ()

re.distribute_events (*events)
re.refresh ()
pygame.time.delay (15)


class CustomTwistedRenderer (Renderer):
TwistedRenderer () - TwistedRenderer

A Renderer that allows the easy integration with Twisted.

Because Twisted's threadedselectreactor *must* be shut down before
the main loop shuts down, this Renderer will keep running until
explicitly told to stop.

Before starting the main loop, this Renderer will check to see if it
has a Twisted reactor attached to it. This is an attribute set like
any of the normal Renderer attributes:

self.reactor = reactor

If self.reactor is None (default), this will behave like a normal
Renderer. If self.reactor has been set, the QUIT signal will call
reactor.stop(), and then wait for reactor.addSystemEventTrigger to
call self.stop(). This function will then stop the main loop.

Usage
-
Install the threadedselectreactor instead of the default reactor:

from twisted.internet.threadedselectreactor import install
install()
from twisted.internet import reactor

In the main section of your program, where you create the Renderer,
just set TwistedRenderer's reactor:

re = TwistedRenderer()
re.reactor = reactor

Everything else is handled internally by TwistedRenderer.

Attributes:
reactor - The twisted reactor attached to the TwistedRenderer.

def __init__ (self):
Renderer.__init__ (self)
self._reactor = None
self._running = False

def start (self):
T.start () - None

Overrides default start() to use self._running. If a reactor is
attached, interleave self.waker

self._running = 1
if self._reactor != None:
self._reactor.interleave (self.waker)
self._loop()

def stop (self):
T.stop () - None

Tells the internal loop to stop running.

self._running = False

def set_reactor (self, reactor):
T.set_reactor (...) - None

Sets the internal reactor.

if not hasattr (reactor, 'interleave'):
raise AttributeError (interleave() method not found in %s %
  reactor)
self._reactor = reactor
self._reactor.addSystemEventTrigger ('after', 'shutdown', self.stop)

def waker (self, func):

[pygame] My game so far, aka need help with movement bug

2009-04-07 Thread Michael Fiano
Not that long ago I posted to the list asking how to fix a problem with
my game: http://article.gmane.org/gmane.comp.python.pygame/17846

Patrick Mullen replied with an answer, and a lot of inspiration for
cleaning up the code. Since then there have been many changes, and
things are now starting to take shape. There is one problem we cannot
figure out. To quote our bug tracker:

The random encounter method is still getting called if the character
is facing an obstacle and trying to move in that direction. The only
way this is possible is if stop in moving object is equal to True.
Somehow stop must be getting reset someplace in order for this to be
happening.

It is also worth noting that the player does not stop animating when
its path is blocked, and looks like it is walking on a treadmill. I
would appreciate any input on the subject. Also, feel free to just try
the game out and offer comments/critique on my disorganized,
overengineered, yet improving code. I included the latest development
snapshot of our game in this message. Also for those that would like to
follow progress on this pygame, we are hosted on launchpad:
https://code.launchpad.net/~bloodcurse/blood-curse/trunk

Thanks in advance,
Michael Fiano