[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] Codebase for tile-based games



On Wed, 14 Aug 2002, Joel Wickard wrote:

> I'd like to see your code.  I'm working on a auto side-scrolling 
> spaceship game.  I'm writing it in C right now, and using python for 
> game scripting... I'd like to see your scrolling algorithms.  Right now 
> I have a map that scrolls by, and a ship that flies around and bound 
> detection to make sure the ship doesn't fly off the screen, but no 
> collision detection as of yet to see if the ship is hitting the map.
> 

I've put up a snapshot of the source and a win32 exe of the scrolling game
I'm working on:
http://www.algonet.se/~tomten/turb/

There are quite a lot of dependencies so if you just want to check it out
use the exe.

Most of the scrolling code is in gamemap.py.

The drawing of the map is called from in the main loop in turb.py or
mapedit.py.
The map object can detect collision on point basis, as it works now it
checks all corners of a rect to see if it collides with a tile and if that
portion of the tile is non transparent.

I'm sure there are a bunch of bugs lurking in the code.
Pleas feel free to do as you please with the code, improvements are
welcomed. 
If you have performance problems fiddle around with the display settings,
hw mode usually requires double buff to reduce flicker.

In the GUI don't click on a empty place in a listbox as this will crash
the app.
The main scripts/exe is turb and mapedit.

Cheers.
Fredrik


____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org