PDA

View Full Version : randomly generate surfaces in pygame



Blacklemon67
September 8th, 2008, 09:50 PM
Is there a way to generate random surface names in pygame? I'm trying to make it so when you press the mouse button, a random image will come up where the cursor is (like a stamp.)

I have the mouse position varuables set up already. I was thinking I could make a list with all of the image names then use .pop(randomnumber) to take it out and return it. But then how do I position them? and If there are duplicates, will the original stamp simply snap to where the new one will go?

I need help :(

Zeotronic
September 8th, 2008, 10:56 PM
Your question is probably within my domain of knowledge, but I don't have the time to figure out a precise answer for it. I will, however, make a pathetic attempt at being useful in suggesting that you ask here (http://z7.invisionfree.com/pygame/) if no one here can help you.