[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Shooting an object
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] Shooting an object
- From: "Charlie Nolan" <funnyman3595@xxxxxxxxx>
- Date: Sat, 23 Aug 2008 23:49:35 -0500
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Sun, 24 Aug 2008 00:49:40 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=kEs/LLGzrhoJhgrObr1oxCVR5h53GAVsxHer4FdKtSE=; b=TtlkyWCz6nFNlQvVuj0rqD/cBMXPQjdyBNJqeqIKrnHpnvLkTbWl72mj41Dh4mKOw/ PrpUBtHYdQGjSbb1JC9fG+P+ayJQDswwgrs+B2zTWmh2M7I7Hlh9u9l+mLg1B2nVEt23 BlGctcprk5NQhbDhsKN7HmaUc6Qr2z4FW1S3I=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=vPKtYpWs4C+OsymSU4xN9Z7W+M/TFM+1WtvbIZDFB2sjBGYL6WgOsVsn5UuH3+whDG nySfdolyMnx3O9DVtrcb4UDCCUp1eBB+a16R5cV6dX93B5dkpgnNKcPkbNVOxNqs968u thN4fPArLYev6Xk9MOhXUjcjlBc2lCvtq2xKA=
- In-reply-to: <20080824010816.9117A7BD45@xxxxxxxxxxxxxxxxxxxxxxx>
- References: <20080824010816.9117A7BD45@xxxxxxxxxxxxxxxxxxxxxxx>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Make sure you store the position as a float internally and cast back
to int (if needed) for display. Otherwise, you can get some annoying
issues when the speed is low compared to the framerate.
On 8/23/08, yanom @linuxmail.org <yanom@xxxxxxxxxxxxx> wrote:
>
>> ----- Original Message -----
>> From: "Ian Mallett" <geometrian@xxxxxxxxx>
>> To: pygame-users@xxxxxxxx
>> Subject: Re: [pygame] Shooting an object
>> Date: Sat, 23 Aug 2008 13:36:28 -0700
>>
>>
>> OK, for shooting, you want to have a class of Bullet. When the enemy
>> fires,
>> add an instance of bullet. The bullet's position will be the enemy's
>> position, and the speed will be a constant broken into x and y components
>> with cos(radians(angle)) and sin(radians(angle)). Each frame, you add the
>> speed of the bullet to the bullet's position.
>
>>
> ok thanks
>
> =
> Tours from Las Vegas
> Bus & Air Tours to the Grand Canyon Monument Valley, Bryce & Zion.
> http://a8-asy.a8ww.net/a8-ads/adftrclick?redirectid=5ec9e22c3648e0f36638288f64c6b564
>
>
> --
> Powered by Outblaze
>