Original Post
I have tilesets, each tile is 32x32, and characters sets, each tile is also 32x32. I want the character to move pixel by pixe, but I can't figure out how to check and see if he is trying to walk on something that he can't (i.e. a wall or tree). With tile-based I would just access my array and with my algorithm, check the tilenumber. But this won't work. I have a theory but it isn't finish:
//In my player class add an index:
int m_iUDMovementIndex; //For up/down
int m_iLRMovementIndex; //For left/right
//And then in my moving function add/subtract 1 for direction
void MoveDown()
{
int UpDown = m_iUDMovementIndex + 1;
if(UpDown <= 0 || UpDown >= 32)
{
m_iRow++;
}
if(g_pMap[(m_iRow * NumberOfColumns) + m_iColumn)] == BLOCKABLE)
{
return;
}
}
Would or wouldn't this work? If anybody knows I would appreciate it.
[edited by - Programmer16 on September 22, 2003 10:34:20 PM]