[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Firing bullets
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] Firing bullets
- From: "Charles Christie" <sonicbhoc@xxxxxxxxx>
- Date: Thu, 5 Apr 2007 11:50:59 -0400
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Thu, 05 Apr 2007 11:51:11 -0400
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=NHgWRgI9bib9U5vV0BFtPyofE7jBI1xpY1d+lTeFZgFyXTWgVafcCBOB0UGDWVTYz0Dx2gv/PKsWUUcaoTssUXGLIu4VQypwwrKZ50bTHtEPPnb5woAN2nK4v5t710gm2D0t9+h+MYhAwAC8VKYDMHejqvD3lbkmg0m4bq770MA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=iATwZDqHY8T3ReUIyHg7E5Ac7UtfwvdFGUOD7yQt3iuoSuPhjW7ItUQoIU4A+PBNkGu0GU8mVZWwVJeFG6Dp1ZLrR4RFlG2VYbrau+GNajL4CPbbig/2CY/U8A1JC1MS1m+74Hg0yVHAPzJhSf/0wdpeQGbRBdI4lhbC0jmDPZg=
- In-reply-to: <8c46c7370704020850t23094424ke1cb3fd1eb4e052e@mail.gmail.com>
- References: <8c46c7370703260637j138b213eg7c18e476e98c20cc@mail.gmail.com> <Pine.BSO.4.64.0703291218420.10698@fuyu.mindrot.org> <383b6d6f0703282327r7a6fac06s8304e852766a5ecf@mail.gmail.com> <20070401204602.6d057c39@compaq> <383b6d6f0704011551w71d11038w27611a3c897594ac@mail.gmail.com> <8c46c7370704020850t23094424ke1cb3fd1eb4e052e@mail.gmail.com>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Alright, so where'd firedBullet come from, and I know that I have to use pygame.time.get_ticks() to say how long a bullet lives but I don't know how to make it so that they die after a certain amount of time... Do I declare that in the bullet class or in the main loop or what?
Here's what I have so far (It's not anywhere near done in any sense of the word. I still need characters, bullets and a scrolling background in order of importance).
Ignore the badly named files, classes and game name. :P
On 4/1/07,
andrew baker <failrate@xxxxxxxxx> wrote:
When you need a bullet,
firedBullet = bullets.pop()
When that bullet "dies",
bullets.append(firedBullet)
Attachment:
TypeNine.zip
Description: Zip archive