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

Re: [pygame] Re: Creating several instances of same image



On Mon, 2004-07-26 at 19:50, Daniel Dornhardt wrote:
> Grant Morganryuuguu wrote:
> 
> > Also you could use a Numeric array. I like them for 2d structures

<snip!>

FORGET Numeric.  You don't need it to do that...  for what you're doing,
a dict-of-tuples is just as effective.

x = 3
y = 4
aliens = { }
for i in range(x):
    for j in range(y):
        aliens[i,j] = Alien((LEFT + i * DISTANCE, TOP + j * DISTANCE))

Dave

-- 
David J. C. Beach
<beach@verinet.com>

Attachment: signature.asc
Description: This is a digitally signed message part