[Tutor] quick query relating to globals (I think)

Glen Edward Wheeler gew75@uow.edu.au
Wed, 26 Jun 2002 01:21:58 +1000


> > program I'm writing (happens to be a game) is pretty huge in
> > scope (at least for me, whose largest project to date is
> > 20,000 lines of python
>
> Thats pretty big for Python, certainly way bigger than anything
> I've tackled in Python(3000 lines I think?). It translates to
> something like 100,000 lines of Java or C++!
>

  I don't know much java, but have done quite a bit of C++...I shudder to
think about the C++ code I'd have to write to even do what I've already
done, let alone when it finally garners a pygame-enhanced UI...The other big
project happenned to be another game, which I wrote for this company in
tkinter (I'm a uni student and I work at this company in the breaks - this
game however is just for fun) ...it was initially just to show how versatile
the tkinter library was but when they saw the little pong-like game, they
wanted the game instead of anything else I was making.  Ended up growing to
silly proportions :).

> > the calls to the display module are mainly there for
> > debugging purposes...eventually when most of the
> > logic of the game is working I will use pygame for
> > the UI and any graphic effects
>
> So can you write thing to have the same interface as the
> Pygame stuff thus making it easy to just instantiate a different
> object when debugging versus production use? Thats the whole
> point of OO design, to make that kind of change near transparent...
>
> [.. cool code ..]
>
> And just comment/uncomment the display you want to use...
>

  Yep, sure can.  I was just fearing stepping into any namespace holes of
'well, there goes three hundred lines of coding...' and it turns out I
almost did...thanks alot for your help!