updated screen shots.
i'm now working on a system that creates and adds NPC objects into the game. In the way I code everything, no functions/objects that are part of an actively blitted screen contain their own while loops. their functions only contain the procedure for one frame. thus:
Code:
unitgroup = VPR.units()
map = VPR.map()
while 1:
mousepos = get_mouse()
VPR.drawscreen(mousepos)
units and the map are initialized. then a while loop is started containing the procedure for drawing one frame. Is this efficient? I'm not sure but it makes it easy to add stuff. I will write an object to create random monsters/NPCs and stuff and add it in:
Code:
unitgroup = VPR.units()
map = VPR.map()
monsters = monstermaker()
while 1:
mousepos = get_mouse()
monsters.make()
VPR.drawscreen(mousepos)
each frame the game checks to see if it should add another monster to the map. A screen display can be added this way too. since the screen display will take space from the mouse-clickable area of the map, it will also modify the mousepos.
Code:
unitgroup = VPR.units()
map = VPR.map()
monsters = monstermaker()
HUD = display()
while 1:
mousepos = HUD.display()
monsters.make()
VPR.drawscreen(mousepos)
so that's whats up next. NPC/monster maker and a HUD display. that will inch closer towards a playable game.
EDIT: sourcecode also added to OP for those who are interested. It really isn't commented yet, and I can't promise it is all very pretty... well, everything but the items.py stuff I think is ok. the function that builds the items object by parsing out the items hash tables is kind of ugly. also, i've never had formal coding instruction, i'm completely autodidactic; so I can't promise that my stuff is done to convention or up to those standards, but I try my best.
lastly, I use a ton of typechecking to do all my hash table functions. this gave some of the people in the #python IRC channel fits, but for my purposes I think it is completely justified: to have completely flexible table shapes I had to know ahead of time what kind of data was in the table. most python people I talked to didn't like this and said I should instead know the shape ahead of time. however since the shape of the table is the shape of bodies, this just isn't possible. I could however rewrite some of the stuff to do some broader typechecking though. I could also just not use hash tables, and this was another suggestion from those in #python, however I think it makes adding stuff easier.