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

Re: [pygame] State Machine Organization



Definetly some of my concerns too... Looking foward to the posts here =)

On 7/4/07, Andre LeBlanc <andrepleblanc@xxxxxxxxx> wrote:
I've spent the past 24 hours or so looking through the source for the PGU Engine and Phil's Pyweek3 example code, and its convinced me that I need to do alot of re-writing.  I'm trying to figure out how to best organize the various states of my RPG, but I'm a little stuck.  should a state be responsible for all of the rendering at a given time?  for example in the case of a top-down RPG, Walking around town is a state, being in a battle is a state, but what about talking to an npc or a vendor in a town?  This would have to bring up menus for the user to navigate, but the scenery in the town should still be painting. NPCs can walk around while you are talking to a shop owner, so should that be a separate state?  I like the way the 'rooms' were subclassed and imported for the pyweek3 game and that's what I'm going for, but how would you transition between these 2 states, if indeed they should be separate.