05-24-2004, 10:59 AM
okay, for my collision detection, i basically draw a small box around my player. i also have a layer for collision detection. to detect whether the player has collided with a wall or something, i check to see if the box the player is in has collided with colour in a certain tile in the collision layer. however, it's very buggy when it works, sometimes preventing you to pass through and then letting you through a bit further down. i believe it's the code i use to read a pixel in an array that's the problem though... tests have pretty much confirmed it. here's the code i have...
when i try drawing one of my collision tiles using this function, the tiles i get drawn are not what they're supposed to be like, i think this piece of code is the problem... any suggestions?
Code:
FUNCTION getpcolor (tilearray(),tbt,x,y)
def seg = VARSEG(tilearray(tbt))
temparray = PEEK(VARPTR(tilearray(tbt + 2)) + x + y * 320)
getpcolor = temparray
END FUNCTION
when i try drawing one of my collision tiles using this function, the tiles i get drawn are not what they're supposed to be like, i think this piece of code is the problem... any suggestions?
Jumping Jahoolipers!