[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] placement of graphics code
> I like to use a Model/View/Controller design, whereby the Game class is
> part of the Model, so it doesn't know anything about blitting. I make a
> PygameView class that handles that stuff.
The MVC thing makes perfect sense to me on a very very very high and
abstract level. Applying it in the real world I find difficult. My
long term goal is an animated roguelike game. That's way beyond my
current skill level, so I'm settling for attempting an animated
version of this old favorite:
import random
x=random.randint(0,9)
guess = None
while (guess != x):
guess = int( raw_input( "guess?" ))
if (guess > x):
print "Too high"
elif (guess < x):
print "Too low"
else:
print "you got it"
Just looking for some guidance on how to independently move & fade in
& fade out the guess prompt, user answer, too high & too low prompts,
and winning message. Basically I can't transition from a top-to-bottom
linear script programmer's mindset.
Alan