Omnimaga

Calculator Community => Major Community Projects => The Axe Parser Project => Topic started by: Raylin on April 18, 2011, 05:27:56 pm

Title: Question
Post by: Raylin on April 18, 2011, 05:27:56 pm
How do you distinguish between different tiles on the ground in Axe, based on pixel-by-pixel collision?
Title: Re: Question
Post by: DJ Omnimaga on April 18, 2011, 05:40:08 pm
By pixel-by-pixel, I assume you mean the pixel-test() command?

Sadly the only way I know of is to store a copy of your map in the back buffer, where every solid tile are plain black (or has a black mask corresponding to every solid part of the tile) and the rest is white, then pixel-test from there, kinda like what I did in Super Sonic Ball. It has been 8 or 9 months since I touched Axe, though.
Title: Re: Question
Post by: Quigibo on April 19, 2011, 12:41:03 am
If you're using a tilemap, you should definitely not be using pixel by pixel collision detection.  Since you already have the tilemap data, its much easier to just write a quick tile detection routine that gets the current tile at a given (x,y) on the map.
Title: Re: Question
Post by: Raylin on April 21, 2011, 05:03:29 pm
Can you elaborate on that?

How do you NOT use pixel by pixel detection in Axe?
Isn't that how smooth collisions and stuff work?
Title: Re: Question
Post by: Builderboy on April 21, 2011, 11:55:12 pm
I think Quigibo thought you meant collision via pixel testing.  Maybe you wanna check out a post I made a bit ago about the subject of per pixel collisions with both square tiles and masked tiles.

http://ourl.ca/4279/169823
Title: Re: Question
Post by: leafy on April 22, 2011, 01:56:06 am
There are ways of accessing which tile the player is in through pointers. I still use Builder's method except I never figured out masked tiles >.<