Re: [pygame] Infinite sprites

2007-05-02 Thread Charles Joseph Christie II
On Wednesday 02 May 2007 06:08:01 pm Will McGugan wrote:
 Hi folks,

 Ive just posted a demo of how to render an infinite number of sprites in
 PyGame.

 http://www.willmcgugan.com/2007/05/02/infinite-sprites-with-pygame/

 Regards,

 Will McGugan

Wow, that's pretty neat!


Re: [pygame] Infinite sprites

2007-05-02 Thread Ethan Glasser-Camp
Will McGugan wrote:
 Ive just posted a demo of how to render an infinite number of sprites in
 PyGame.

This is a very clever trick, and it makes a neat demo. One thing that
I would do to make it look a little prettier is to prerender the first
k frames with the ball having a decreasing alpha, so that the ball
looks like it's fading in.

While I wouldn't say you've managed to render an infinite number of
sprites, this technique might come in handy for some of the bullet
hell games people were talking about around here.

Ethan



signature.asc
Description: OpenPGP digital signature


Re: [pygame] Infinite sprites

2007-05-02 Thread Charles Joseph Christie II
On Wednesday 02 May 2007 07:42:27 pm Ethan Glasser-Camp wrote:
 Will McGugan wrote:
  Ive just posted a demo of how to render an infinite number of sprites in
  PyGame.

 This is a very clever trick, and it makes a neat demo. One thing that
 I would do to make it look a little prettier is to prerender the first
 k frames with the ball having a decreasing alpha, so that the ball
 looks like it's fading in.

 While I wouldn't say you've managed to render an infinite number of
 sprites, this technique might come in handy for some of the bullet
 hell games people were talking about around here.

 Ethan

Am I the one that started the whole idea of bullet hell games in this mailing 
list? heh, well he's definitely right that this little trick would make 
rendering hundreds of bullets at a time less painful...

...If I could wrap my empty head around it. T_T


Re: [pygame] Infinite sprites

2007-05-02 Thread Ethan Glasser-Camp
Charles Joseph Christie II wrote:
 Am I the one that started the whole idea of bullet hell games in this mailing 
 list? heh, well he's definitely right that this little trick would make 
 rendering hundreds of bullets at a time less painful...
 
 ...If I could wrap my empty head around it. T_T

My original email had an explanation of the technique but I thought
that might be considered spoilers :). It might help you understand if
you went into the code. At the very top, there's a line called
FRAME_COUNT. Change it to 1 or 2 and see what happens.

It's a cute trick, but it relies on certain properties of the sprite
motion -- namely that all sprites are identical, and are all following
the same trail, but are just on different places on it. I think
generally the use of sprites in a game runs counter to these
assumptions -- you introduce a sprite class because the sprites aren't
identical, and they move differently. But like I said, maybe bullet
hell games.

Ethan



signature.asc
Description: OpenPGP digital signature


Re: [pygame] Infinite sprites

2007-05-02 Thread Charles Joseph Christie II
On Wednesday 02 May 2007 07:58:03 pm Ethan Glasser-Camp wrote:
 Charles Joseph Christie II wrote:
  Am I the one that started the whole idea of bullet hell games in this
  mailing list? heh, well he's definitely right that this little trick
  would make rendering hundreds of bullets at a time less painful...
 
  ...If I could wrap my empty head around it. T_T

 My original email had an explanation of the technique but I thought
 that might be considered spoilers :). It might help you understand if
 you went into the code. At the very top, there's a line called
 FRAME_COUNT. Change it to 1 or 2 and see what happens.

 It's a cute trick, but it relies on certain properties of the sprite
 motion -- namely that all sprites are identical, and are all following
 the same trail, but are just on different places on it. I think
 generally the use of sprites in a game runs counter to these
 assumptions -- you introduce a sprite class because the sprites aren't
 identical, and they move differently. But like I said, maybe bullet
 hell games.

 Ethan

Oh... that's still cool, though. Maybe after I fix my little game thing that 
currently is out of order, I could implement something like this? It would be 
cool to have, oh say, 2 or 3 of these running at the same time making a 
pattern. Would that make sense or would it be asking for trouble?