i use the state change raising a ChangeState( newstate ) exception, and the
loop are ready for try and except this and change the value self.state

Good luck

2007/7/19, Simon Oberhammer <[EMAIL PROTECTED]>:

Thank you, kschnee... looks good to me - I will use that in my next game.
But imho adding the widget/interface info+sampleclass is too much for an
otherwise nice and simple cookbook-entry
 simon

ps.: And you code tells me that calling  'screen' what you call 'state' is
not too far fetched ;-)
> next_screen = self.game_state.pop()

On 7/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I found a better way than I'd done before to switch between the various
> states of a game, such as a main gameplay screen and a status screen.
> Attached is some example code. Something for the Cookbook, maybe?
>




--
Juan José Alonso. KarlsBerg.
eMail: [EMAIL PROTECTED]
MSN: [EMAIL PROTECTED]

Reply via email to