Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Pixel Perfect Collision :)

Author
Message
xbandages
14
Years of Service
User Offline
Joined: 30th Mar 2010
Location: Michigan
Posted: 30th Mar 2010 19:35
Hi everyone, I'm new to the forum and DarkGDK as well (loving it so far).

2D
I have created a few programs with full axis movement and an animated character along the X-axis (haven't made the animation for Y-axis yet...).

The only problem I have come across was the collision detection and invisible walls. I know what the problem is and have searched the forum for better solutions as well. I am more interested in making my own solution for a "pixel perfect" collision.


The only thing I really need is a way to "scan" the sprite. As in, start at height y and work its way down a vertical plane and if it comes across anything thats not transparent (R255,0G,B255), then it will save that as a 1 in a 2d array and the same for the horizontal plane.

I have an idea for making this work, and it will be sweet if it does. All I need is a way of scanning the sprites w/ or w/out DarkGDK...maybe some function that is already implemented in directx?

If anyone has any great pointers or questions, PLEASE post.

Thanks!!
xbandages
14
Years of Service
User Offline
Joined: 30th Mar 2010
Location: Michigan
Posted: 30th Mar 2010 19:54 Edited at: 30th Mar 2010 20:49
I just found out that I need to work with bitmasking. This will make the collision outcomes process much faster.

Currently reading up on bitmasking (kinda what thought I needed to do)
haliop
User Banned
Posted: 1st Apr 2010 16:04
why dont you share it with us?

Login to post a reply

Server time is: 2024-05-18 07:45:48
Your offset time is: 2024-05-18 07:45:48