Re: Pythonic way to handle coordinates

2009-01-17 Thread andrew cooke
although james's idea is quite neat (especially the idea of heritable classes), my initial reaction was that it's too over-engineered. so here's a different approach. there are two "tricks" that can help make using tuples easier: (1) unpacking the return value. (x, y) = returns_a_point() x +

Re: Pythonic way to handle coordinates

2009-01-17 Thread James Stroud
Pierre-Alain Dorange wrote: What is the elegant way to handle coordinates ? Do i need to continue using tuples or do i need to write a Point class. I feel a point class would be nice, because i could implement operators with it ? But i think Point class must exist allready ? My instinctive adv

Re: Pythonic way to handle coordinates

2009-01-17 Thread The Music Guy
On Jan 17, 2:48 am, pdora...@pas-de-pub-merci.mac.com (Pierre-Alain Dorange) wrote: > Hi, > I'm used python for 3 months now to develop small arcade games (with > pygame module). > > I just got a question about coordinates handling. > My games are in 2D so i deal with x,y coordinates for sprites (b

Pythonic way to handle coordinates

2009-01-17 Thread Pierre-Alain Dorange
Hi, I'm used python for 3 months now to develop small arcade games (with pygame module). I just got a question about coordinates handling. My games are in 2D so i deal with x,y coordinates for sprites (but woudl be the same u-issue in 3D). At the beginning i simply use x and y to pass to my metho