[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Pixel perfect collision detection sugestion
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] Pixel perfect collision detection sugestion
- From: Peter Nicolai <pnicolai@xxxxxxxxx>
- Date: Sun, 11 Sep 2005 16:14:24 -0400
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Sun, 11 Sep 2005 16:14:38 -0400
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=dnuxSa9KldrduZHn9n+sabRzAHF+HCEotMTntJsFL+N9GsEtVo9N9/slONL115Kena03cBQgTNhzHtWGih0tjt8mrArhp93fc+PS7R4V14WzhXOcrh892eY6zWoSm9wDCMqH/K/SPGbG0f1wS2OH4Q6bLidMMAGIFjS7xm1kCc8=
- In-reply-to: <20050911182948.29E77E81D9@k2.scorpionshops.com>
- References: <20050911182948.29E77E81D9@k2.scorpionshops.com>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
ClanLib has a pretty fancy collision system, might be worth checking out:
http://clanlib.org/docs/Overview/collision_detection.html
On 9/11/05, John Eriksson <john@xxxxxxxxxxxx> wrote:
> *smile* There are as many aproaches as games and game developers. None of
> them are wrong as long as they make the game experience tick.
>
> When using pixel perfect you must, in many cases also have a
> different/smaller hitmask and not generate it from the sprite image
> directly. Say for example a rocket... you don't want the tail flames to
> cause a collision, so the hitmask must be set by using a separate image.
>
> I really dont belive that rectangle collisions should be replaced by pixel
> perfect...but both of them should exist.
>
> /John
>
> > Not so. You'll find in the majority of games, the collision box
> > is slightly smaller than the in-game sprite for the player. For
> > an extreme example, try playing a Japanese shmup, where the hit-box is
> > limited to the player's cockpit.
> >
> > When I wanted to modify the rect collision system in my engine, I found
> > it rather easy to decouple the main rect and substitute my own
> > arbitrary rect (which was positioned at the "feet" of the
> sprite, same
> > width, half as tall) and collision functions using these new rects by
> > basically overloading the default classes and functions. So, I'm
> > guessing that regardless of the final approaches, they should all be
> > abstracted that switching between them should remain this painless.
> > -- Andrew Ulysses Baker"failrate"
> >
>
>