[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] sprites in arrays, instead of simple variables
- To: pygame-users <pygame-users@xxxxxxxx>
- Subject: [pygame] sprites in arrays, instead of simple variables
- From: Paulo Silva <nitrofurano@xxxxxxxxx>
- Date: Tue, 7 Jul 2009 16:55:52 +0100
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Tue, 07 Jul 2009 11:55:56 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=kUqReYqirk3+8Rslk6ljaATOyokQ58TimCND0S57mII=; b=nBB1iAK8K92yPDB3x77+z6npoNjSyd0obQRSXxK08r3WuiLreydDAekv0uMeI5jyKQ Yo2USNnEniMB9XATsIFKvMODAweCRljzCa8Bn6ToFUeT9/qFOYyDv6z93KBDBkvYuv9T etwS9LzLqqAwpdIys9VQvbXw9fR5lQg7yLeX4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=qp4Y2GL4cjS5tIa7MqI01Pub1iXYzarCFZSiLOY0lNaQ3si2SkgOSEjh+ALT7PKBic 7GxjYHDXmJNVgbEMn6vpOu0PIQ/MSWzY+E5fUyNAfTok0c5v29zfvZuHzp5wffSMA1fk ZS1ALwJ80Y/xI1XKbL0+goCNYndd9NabB6+BA=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
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! :)