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

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



Good point. I just changed all my Numerics to dicts since I wasn't doing any shape or slicing on them.

Grant


On Mon, 26 Jul 2004 21:15:21 -0400, David J. C. Beach <beach@verinet.com> wrote:

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