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

Re: [pygame] Some Platforms



Hello Matt

Of course, ANY help is welcome, i've recently changed my code from:
	sprite always asking; I'm on the platform??
for:
	platfom sayig, you are not on me, so start falling

This adds more complexity, but could be used for some games.
For example, if you want a sprite to always be on the platform, the simpler 
version is well, but what happens if a platform just disappear or rapidly 
change it's position?? the sprites on it have to start falling.
Of course this is ugly for elevators, like in Abuse, when it does not matter 
how the elevator falls, the player should always be on it.

Ok, forgive all the above kinda self-notes(i tend to do this). As you said, 
generic python list are the best implementation combined with Rects.
Rects, are, from my humble opinion, THE way to think games in pyGame.

And about groups and lists:
I was a little nervous when I entered all sprites in order to the group  that 
would be represented, and I obtained a disordered group overlapping itself 
(as you can confirm in my code)

Also, the official pyGame homepage links to a selfcalled "PyPlatform" engine, 
that givesme a fu**ing 404, so what is this about?? I'm really interested.
I'm from the 'doItYourselfAndBeOriginal' mind, but any abstract code is very 
welcome :-)

So sendme your code/notes

> 	I can send you some code/notes if you want. I worked on this and collision
> detection quite a bit until I really got it right (the two are somewhat
> correlated), on my own game. In both situations, I saw my code and logic
> get a bit simpler and cleaner after I had the core functionality well
> implemented and had achieved a better understanding of just what I was
> doing. I simply have some generic Python lists for stuff I want to scroll
> (my Pygame sprite groups are used mostly for precise control over the
> render order of various types of sprites). By using lists, it's a cinch to
> keep shuffling sprites around on the virtual world (and even use them in
> collision detection for off-the-screen bullets etc, if I so choose) while
> still keeping them out of sprite groups.
>
> 	-Matt Bailey