Pixel perfect 2D collision detection with Allegro

This is a discussion on Pixel perfect 2D collision detection with Allegro within the C++ Programming forums, part of the General Programming Boards category; Hi all, I'm struggling with implementing pixel perfect 2D collision detection for my simple 2D game. I'm also using Allegro, ...

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    32

    Pixel perfect 2D collision detection with Allegro

    Hi all,
    I'm struggling with implementing pixel perfect 2D collision detection for my simple 2D game. I'm also using Allegro, if that helps.

    I know what the basic algorithm is, but... is there a way for me to use allegro to simplify this?

    Notes:
    I have sprites loaded from bitmaps, but I rotate them according to the way they're facing (360 degrees are possible) I've also created a parallel list of mask bitmaps with black for where there's background and white for where that pixel is part of my character.

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    You might want to look at some sample source for collision detection. I don't use Allegro, but I know there are several SDL libraries that do this.

    [edit] You might try google, if you haven't already: http://www.google.ca/search?hl=en&q=...etection&meta= [/edit]

    [edit=2] This should probably be in the Game Programming Forum. Nothing you can do about it now, though. [/edit]
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Pixel perfect collision / "terrain" destruction
    By cboard_member in forum Game Programming
    Replies: 1
    Last Post: 09-09-2006, 01:54 PM
  2. 2D pixel perfect collision detection
    By Warlax in forum Game Programming
    Replies: 0
    Last Post: 06-22-2006, 08:39 AM
  3. 2D sidescrollers and collision detection
    By funkydude9 in forum Game Programming
    Replies: 16
    Last Post: 03-26-2003, 09:22 PM
  4. bounding box collision detection
    By DavidP in forum Game Programming
    Replies: 7
    Last Post: 07-08-2002, 12:43 AM
  5. Replies: 4
    Last Post: 05-03-2002, 10:40 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21