[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Starting a game
On Jun 29, 2007, at 2:34 PM, Charles Joseph Christie II wrote:
Alright. I don't know if I'm going to be using that MVC stuff...
although I
might reprogram the game to use it later, if I decide it'll be
better... but
I want to start a game now! I'm so bored just sitting here that I
may as well
start something.
So now, I'm going to get started. But the problem is that the last
time I
tried it, I over-complicated it by using advanced sprite functions
that I
didn't understand at all. I'm still trying to figure out an eaiser
way to
draw stuff than making everything a class and making it extend from
pygame.sprite.Sprite (painful >.<)
My advice, come up with a game concept, then come up with one aspect
of it that you can implement easily and do that first. For example,
if you were making a tiled rouge-like game, you could come up with
some simple art for a player character (like a knight or mage) then
make it so you move the character in a grid on the screen. If you are
making an asteroids type game, make it so you can turn your ship,
then implement thrust, etc.
Try to bite off little chunks you can do in a few hours time and
don't try and invent the whole thing at once, learn as you go.
Some kinds of games (such as the rouge-like one I mentioned) already
have lots of pygame implementations, and there are frameworks that
can help with things like tiling, level design, etc. Sometimes though
it may be as hard to learn to use the framework as it is to learn
pygame itself, so beware of biting off more than you can chew.
Also, some concepts of object orientation seem to have bit me. How
should I
have classes interact with each other? I know I was doing it
completely wrong
last time, and one of my friends called me on it. But I forgot how
he said I
should do it...
Look at other people's code. Games and OO programming go hand-and-
hand IMO and it really helps you if you have the right level of
abstraction. The sprite class is supposed to help you in this regard,
giving you a small organizational unit for the components of your
game. OTOH, using Sprite may make it more difficult to implement
certain patterns (i.e., MVC). But to risk overusing a cliche: "Don't
let the perfect be the enemy of the good", figure out how to make
something work first then learn how to make it better. Don't try to
learn everything at once.
Maybe you said this before, but what kind of game are you making? Is
there another pygame that has similar ideas and elements you can
borrow from?
-Casey