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.

DarkBASIC Professional Discussion / Pixel Perfect Collision

Author
Message
Oneka
21
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 19th Aug 2004 12:05 Edited at: 19th Aug 2004 12:22
in my new game Kupo The Adventurer I need to know how to do PPC for sprites without DLL....any advice?
or a substitute


Making better games everday!
Oh yeah and just so you know its Oh-nek-a not One-ka!
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 19th Aug 2004 12:54
i think the simplest solution is to use memblocks. make a memblock for each sprite in your game (make memblock from image), and store it.

when you want to check for a collision, refer to the memblock data for each pixel. if you are using .png files, you can check the alpha byte to see if the pixel is part of the sprite or not. or if you are using keyed .bmps, just check for your background color. if you need an explanation of how to read memblock image data, I or many other users can explain it. Phaelax also wrote a tutorial about it that's floating around.

just bear in mind that the make memblock from image command makes totally differently formatted memblocks depending on screen depth (32 / 16).

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
Oneka
21
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 19th Aug 2004 13:31
nvm I got it


Making better games everday!
Oh yeah and just so you know its Oh-nek-a not One-ka!
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 19th Aug 2004 13:51
what solution did you use, I'm sure other users would like to know

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
Skeletor
21
Years of Service
User Offline
Joined: 21st Jun 2004
Location: florida
Posted: 19th Aug 2004 14:12 Edited at: 19th Aug 2004 14:13
Hi, if your way doesnt work, check out this thread... http://forum.thegamecreators.com/?m=forum_view&t=35924&b=4
and Look where I posted ( Its the 9th Post). It shows a very simple way of Collision that was used in Dark Fighter by MIR and is being used in a 2d shoot em up game I am making.


http://www.angelfire.com/games5/db_games/
Oneka
21
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 20th Aug 2004 01:51
yeah I found that out iam using a combination of the both iam using Iam's Pixelperfect collision with the box technique and I have a tiny pixel that you cant see one pixel infront of the area I want to make the collision area and I have one left right top and bottom of the character and it works great and its about 150lines of code (included Iam's PPC)


Making better games everday!
Oh yeah and just so you know its Oh-nek-a not One-ka!

Login to post a reply

Server time is: 2025-08-09 01:32:12
Your offset time is: 2025-08-09 01:32:12