Original Post
Ok, I finally found out that I need to learn how to make objects in a tile based game. How do I define an object and how do I detect collisions with the objects and the map? I did it like this, but not sure if it''s the best:
typedef struct
{
int tileid;
RECT boundrect;
}tileobj;
tileobj [10][10];
char map[10][10];
so while I blt I read in the rects and ids into the tileobj array. I blt using the map array. And to detect collision I go
if IntersectRect(tileobj[2][2].boundrect,playerrect)
{
player stop moving;
}
This only detects collision for one tile and it seems I''m gonna need a lot of if statements to detect collisions for a whole map!
Please give me suggestions and source code. I need to know the basics of objects and coords. I am very confused as to what to do.
THX!