[pygame] sprite collisions - looking for simple snippet

2009-07-12 Thread nitrofurano

hi!
i'm having difficulty on coding a small nippet of sprite collisions on  
pygame


on sdlbasic, it's extremelly simple to get working (please don't worry  
about PEP8... :/ )

http://img19.imageshack.us/img19/6966/bht0.png
http://img19.imageshack.us/img19/8138/bht1.png
http://pastebin.com/f289d80eb

i imagine it can be possible coding similar stuff on python pygame, using  
as few lines of code as this one, and providing similar results

all feedback is very apreciated, thanks! :)


[pygame] sprites in arrays instead of

2009-07-07 Thread nitrofurano
hi!
recently i coded this humble snipped using sprites from subsurfaces:
http://pastebin.com/f2b05bf70

the question is: it seems to be simple working with just 4 different
sprites, one in each variable - but when they are hundreds or
thousands, this task become to be very boring - can we store sprites
into arrays instead of simple variables?

another question: this example became slow when the ammount of sprites
on screen are 256 or more, on a Pentium4-sse2 (i'm using Ubuntu Linux
9.04) - is there some way to speed up this task, and allowing as much
as 1000 sprites or more for this? (i'm interested on trying to start
coding those bullet-hell doujin shumps, and this snippet were for
testing how many sprites we can count with for this kind of game
development)

thanks! :)