Thanks for trying to help, but both examples are testing collisions against either map or screen buffer.
I need collision test between two sprites that would disregard map or screen buffer data, a function perhaps that when called with sprite ids of the sprite to test against and sprite that is testing plus x/y of both (all sprites in my game are 8x8 so no worries there) and each sprite's transparent color (some of my sprites needs to use black as the color so have different transparent one).
@darkhog your appraisal of at least one of the above links is incorrect :)
if you look carefully and read the text on the screen, https://www.lexaloffle.com/bbs/?tid=2179 shows pixel perfect collision between two sprites. the demo even shows you visually which pixels are colliding.
|This is the result, a little demo that shows pixel (and basic box) collision feedback in real-time on a couple of sprites.|
looking at the source it's even more obvious:
-- pixel-perfect collsion: -- takes two sprite sheet -- numbers and a pixel offset -- in x and y of the second -- sprite from the first. -- return true if any pixels in -- sprites overlap, false -- otherwise function collide_pixel(sp1,sp2,xoff,yoff)
[Please log in to post a comment]