Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #45387

Re: Question re: objects and square grids

Date 2013-05-15 21:20 -0400
From Dave Angel <davea@davea.name>
Subject Re: Question re: objects and square grids
References (2 earlier) <5193E8C0.1060004@davea.name> <CAPp_YbVBm2444Ea-pUy2Zn2YbB1mKmDoasmNXp7DPAbs8Sra4g@mail.gmail.com> <CAPp_YbVk4NwSxSpVEASCk0w=1mPoRii+RjccnXNLP+8igf3H2g@mail.gmail.com> <519425AC.3070605@davea.name> <CAPp_YbWPP-ptEuhnsqt7SvmBB2Ft_5XpiTV1dARMe9Ef=eYwhQ@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1729.1368667255.3114.python-list@python.org> (permalink)

Show all headers | View raw


On 05/15/2013 08:53 PM, Andrew Bradley wrote:
>>
>>
>>   <SNIP>
>>
>>   So now, how can I utilize this new grid list? Thank you for the
>>>> help so far, I feel like the entire grid is now being worked out.
>>>> -Andrew
>>>>
>>>>
>> That's a Pygame question, and I told you at the beginning, I can't really
>> help with that.  I'd like to learn, but not this week.
>>
>> Others - can you show some minimal code to use these grid parameters to
>> color selected squares of the pygame window?
>>
>>
> Yes, I would very much like some help or general advice now about utilizing
> this grid thing. How can I refer to these square's new numerical values to
> do things with them? Will I be using things like "grid[0][1]" in specific
> functions and methods to refer to squares now?

Yes, exactly.  Any place in your code (the part I cannot help with) that 
you need to specify a rect, you can specify something like grid[3][18]. 
  Eventually, as Ian pointed out, you'll want to store more information 
about each cell.  But at that time, you could have a more complex object 
(that YOU define) instead of just a rect.  I just don't think you're 
ready for defining such an object.

> That is what I would like to
> do, somehow.
>



-- 
DaveA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Question re: objects and square grids Dave Angel <davea@davea.name> - 2013-05-15 21:20 -0400

csiph-web