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

Re: [pygame] learning pygame: what to focus for a board game?




On Jun 15, 2007, at 3:16 AM, massimo s. wrote:

Luke Paireepinart ha scritto:

So I'd like to know:
- Should I learn sprites or can I just learn surfaces? I'd like to have
(or at least plan to support in the future) some (very simple)
animation, like the tile rotation when asked to rotate it, or a fast
movement of the tile into the board. Can I make it just with rectangles
or do I need sprites?

I'll preface this with "huh?"
what do you mean "the tile rotation when asked to rotate it?"

Sorry. It was late in the night and I was getting sleepy...

Once a tile pops out from the random sample, I assume it will be showed,
but the user will want to rotate it, often, before placing it in the
board. What would be nice is to have the rotation not to be completely
instantaneous, but to actually see the tile rotate somehow smoothly.

Is this 2D or 3D rotation? The former is pretty easy using pygame.transform.rotozoom() and the quality and speed is very good, probably fast enough to do dynamically (i.e., no pre-rendering), but that depends on the size of the image your are rotating.

If you want 3D rotation, then you're going to want to use opengl.

It is that kind of details I won't enter into for a LOT of time, and
probably never. But programming other projects teached me that planning
in advance for flexibility in adding features is good (I spent painful
days refactoring a data analysis application in my lab...) , so if
sprites allow this and more, I'd start directly with sprites when
planning graphics.

Sprites buy you quite a bit with little cost to you. I would recommend using them from the get-go. Since sprites are composed of surfaces and rects you'll need to learn about these too, but the pygame implementation of these are convenient and easy to use/ understand IMO.

-Casey