Welcome

28 views
Skip to first unread message

Gummbum

unread,
Feb 20, 2011, 5:20:49 PM2/20/11
to Gummworld2
Hi and welcome, Elliott.

As you can see, the group hasn't really started yet. Cuz well... I
would only have been talking to myself! =)

Do you have any topics or ideas you'd like to discuss?

Gumm

Elliott

unread,
Mar 31, 2011, 2:54:35 PM3/31/11
to Gummworld2
Hello,

First, thanks for the great work! I continue to be pleasantly
surprised by the functionality. I'm working on a little turn based
strategy game; You move tiny soldiers about the map and try to destroy
the other player's tiny soldiers. I have two questions for you if
you're game:

First, Is there a method that converts a tile on the grid, say [5,2],
to maybe a vec2d position to draw a sprite? Or would I do some
addition based on my tile size and the number of tiles across I need
to place my object? I took a quick look through the documentation but
it's possible I just missed it. (I'd like my soldiers movement to be
constrained to the squares so they only move a square at a time.)

Second, How would I make a splash screen that just displays a picture
and a start button. Would I perhaps set a full-screen sprite to show
as long as some value is true, and then let the button set it to
false? I noticed that you have PGU in the third party folder, could I
use that to show a button?

Thanks again,
Elliott

B W

unread,
Mar 31, 2011, 6:57:16 PM3/31/11
to gummw...@googlegroups.com
Hi, Elliot. I'm happy to know you're getting some good use out of the library.

In order to get what you want from a tile ID, a small series of conversions would be needed.

1. Convert the tile ID to world coordinates: world_pos = State.map.tile_size * (5,2). Note, this is the topleft corner.
2. Convert the world coordinates to screen: screen_pos = State.camera.world_to_screen(world_pos). This will produce the topleft corner of the grid square.

For a splash screen you could do as you suggest, a full picture, or blit a few small images here and there. Or even moving sprites. You don't necessarily need a button, unless you really want one. :) You could just make "the whole screen" your button by checking for a MOUSEBUTTONDOWN or KEYDOWN event.

I did kind of a splash screen in the bunny mini game. It displays a countdown, then you start playing. I was not entirely happy with it, but it fit the mini game well enough. For my PyWeek practice game we did a full blown menu system--using homegrown pygame, not pgu. But now splash screen (yet). :)

Hope that helps. If you have any other questions, feel free to shoot 'em my way.

Cheers.

Gumm
Reply all
Reply to author
Forward
0 new messages