[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] the game.Mainloop() myth
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] the game.Mainloop() myth
- From: altern <altern2@xxxxxxxxx>
- Date: Thu, 25 Oct 2007 08:57:44 +0200
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Thu, 25 Oct 2007 02:57:59 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; bh=iKLlcj/b59V4GO9ecFQCqNpalmHuSxMKKSpdYDDL0eM=; b=oMchShKYVOBktVIuzwFFc9oqZ/KbLt4/iQ8uDQkkjf1+fjRyfor61pXzBWdfbKf+86bwr2LD2WgGSzzuanwLue4QGLWdVPbRhRRLnZN7v+XAq+5v58qUY9+SAkDO8mKfv4mmNJ83hW23zSWQlS7AhQF1rSH1rDbYAqrfDTw1myk=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=CQBFbK87riCpPst0Z37zROq13iIvgNCmFrN7xLDC6e9iUmVvEOKnO0qXzXGvzoCX88NedRLQtrt8u5sLHZ8+XKJ6eyIb4dgF3i1TME9n+NyiQXMowXxvldm3Rhk2nYWOinwoolE5qU6CGYAgZkzZzcoyhea7894s+/cDTlYRQpI=
- In-reply-to: <3125958d0710242125y14ee8ca3j26e128252c69c332@xxxxxxxxxxxxxx>
- References: <3125958d0710242125y14ee8ca3j26e128252c69c332@xxxxxxxxxxxxxx>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
- User-agent: Thunderbird 2.0.0.6 (X11/20070728)
hi eric
as far as i understand there is no such function in pygame. have you
checked the docs?
http://www.pygame.org/docs/ref/event.html
In pygame you create your own loop, check the basic examples included
with pygame like the chimp example
http://www.pygame.org/docs/tut/chimp/ChimpLineByLine.html
this is the main loop in that example
while 1:
clock.tick(60)
my guess is that you have seen that in someone's code. you can code
something like this and it should work.
class GameLoop :
def MainLoop(self) :
while 1:
clock.tick(60)
if __name__ == "__main__":
gameloop = GameLoop()
gameloop.Mainloop()
of course you would need to import and init pygame at the top of the
script...
enrike
Eric Hunter(e)k dio:
okay so I'm trying to use the .Mainloop() and am getting an error.
[error]
GameLoop instance has no attribute 'MainLoop'
[/error]
and the code is
[code]
if __name__ == "__main__":
gameloop = GameLoop()
gameloop.Mainloop()
[/code]
is the Mainloop() just a myth or does it really work? do I need to
import a certain function or something?
thanks in advance,
-Eric