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

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



Thanks everyone for all your help. You've given me some very useful code
snippets for me to get my head around :)

I got it working yesterday with a list as recommended, I'll give it a go with
Numeric and dict-of-tuples to see which I prefer, and also to help me round the
learning curve - hopefully the right way - lol.

Many thanks again
Nick.


Quoting "David J. C. Beach" <beach@verinet.com>:

> 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>
>



 
-------------------------------------------------
Everyone should have http://www.freedom2surf.net/