[pygame] refresh problem

2007-09-04 Thread pistacchio
hi to all! this is my first post in pygame (windows xp, python 2.5). i've started using pygame some days ago and after a bit of coding i'm completely stuck. the problem is that even the simpliest code like import pygame from pygame.locals import * pygame.init() screen =

Re: [pygame] refresh problem

2007-09-04 Thread Luke Paireepinart
pistacchio wrote: hi to all! this is my first post in pygame (windows xp, python 2.5). i've started using pygame some days ago and after a bit of coding i'm completely stuck. the problem is that even the simpliest code like import pygame from pygame.locals import * pygame.init() screen =

Re: [pygame] refresh problem

2007-09-04 Thread Greg Ewing
pistacchio wrote: while not done: pygame.display.flip() for event in pygame.event.get(): if event.type == QUIT: done = True Note that pygame.event.get() doesn't block, so you're spinning in an extremely busy loop here. The screen mightn't be getting a chance to

Re: [pygame] refresh problem

2007-09-04 Thread Lenard Lindstrom
James Paige wrote: On Tue, Sep 04, 2007 at 05:09:14PM +0200, pistacchio wrote: Greg Ewing ha scritto: pistacchio wrote: while not done: pygame.display.flip() for event in pygame.event.get(): if event.type == QUIT: done = True Note that

Re: [pygame] refresh problem

2007-09-04 Thread pistacchio
Lenard Lindstrom ha scritto: James Paige wrote: On Tue, Sep 04, 2007 at 05:09:14PM +0200, pistacchio wrote: Greg Ewing ha scritto: pistacchio wrote: while not done: pygame.display.flip() for event in pygame.event.get(): if event.type == QUIT: done = True

[pygame] bidimensional arrays or the quick way to maps

2007-09-04 Thread pistacchio
maps are certainly a very common feature in game development. the easiest way to trace maps (and the one that i've used in other languages in tha past) is to use multidimensional arrays. so, a tile-map, can be stored and worked on as a simple array (or list) that goes like this:

Re: [pygame] bidimensional arrays or the quick way to maps

2007-09-04 Thread Ulf Ekström
You can use lists of lists, for example with a function like def makearray(w,h): a = [] for i in range(w): a.append([None]*h) return a Then you adress the elements like a[2][3]. This is probably not very efficient, but for maps it should be ok. Ulf

Re: [pygame] refresh problem

2007-09-04 Thread Luke Paireepinart
pistacchio wrote: Lenard Lindstrom ha scritto: James Paige wrote: On Tue, Sep 04, 2007 at 05:09:14PM +0200, pistacchio wrote: Greg Ewing ha scritto: pistacchio wrote: while not done: pygame.display.flip() for event in pygame.event.get(): if event.type == QUIT:

Re: [pygame] bidimensional arrays or the quick way to maps

2007-09-04 Thread Richard Jones
On Wed, 5 Sep 2007, pistacchio wrote: maps are certainly a very common feature in game development. the easiest way to trace maps (and the one that i've used in other languages in tha past) is to use multidimensional arrays. so, a tile-map, can be stored and worked on as a simple array (or

Re: [pygame] bidimensional arrays or the quick way to maps

2007-09-04 Thread Greg Ewing
pistacchio wrote: tile_map[x][y] = tile_number now, probably i'm missing a basic feature of python, but it seems to lack of a native support for multidimensional arrays. There's nothing built-in (yet -- there might be in py3k). If you just want to be able to write x[i,j] instead of

Re: [pygame] bidimensional arrays or the quick way to maps

2007-09-04 Thread pistacchio
Richard Jones ha scritto: On Wed, 5 Sep 2007, pistacchio wrote: maps are certainly a very common feature in game development. the easiest way to trace maps (and the one that i've used in other languages in tha past) is to use multidimensional arrays. so, a tile-map, can be stored and worked

Re: [pygame] refresh problem

2007-09-04 Thread pistacchio
Luke Paireepinart ha scritto: ght-click and choose edit with IDLE. instead, open IDLE from the start menu and load your files from within IDLE (should be in 'recent documents') there's some problem with IDLE and using the separate subprocess that only comes up when you right click and edit, so