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

Re: [pygame] Rain Generator



Kamilche wrote:
Kai Kuehne wrote:
Looks similar to http://www.scriptedfun.com/pygame-starfield-rain/
but it's cool.


Yep, that's the site that inspired me. Mine is a different solution to the same problem, but the raindrops look similar, that's true. If you look closely, his are leaving trails behind - mine isn't, it's using an entire raindrop with a tail that 'peters out.'


Luke noticed the dirty rectangle code wasn't working quite correctly, so I've modified the code and reposted it at http://incarnation.danbo.com/ubbthreads/modifypost.php .
I also added some features, such as:


* Speeding up big raindrops so they appear closer
* Changing the translucency of raindrops so smaller ones are dimmer and look farther away
* Optimized the particle engine so the raindrops are created once when the generator is created (as opposed to being continually created and destroyed)
* Put the drops on a timer so they move at the desired speed regardless of how often you call the rain generator
* Made the left and right arrow keys decrease/increase the rain speed.


plus miscellaneous enhancements.

Now just add little splashes at the bottom, a rain sound effect, and randomly change the background to white for a few frames (to simulate lightning)
and you can sell it as a screensaver!
I'm excited :D