tile collision

Started by
8 comments, last by computer_guy 20 years, 10 months ago
Hi, I''m trying to make a 2d side-scroller and am wondering how I would do tile collision. Could someone tell me or direct me to a good resource. Thanks in advance.
I'll Be Back
Advertisement
between what?
tile to tile?
tile to object?
How appropriate, you fight like a cow!
Oh sorry, Between the character and the tiles
I'll Be Back
It''s depends how you move your character, how your character is presented (a circle, a rect)...
how you move your character? 1 pixel at time or one tile at time?
How appropriate, you fight like a cow!
I move the background one tile at a time. The tiles are 16*16 pixels in size.

By the way i''m using C++ with DirectDraw7
I'll Be Back
well, if you can know what type the next tile will be, so it''s not a problem...
How appropriate, you fight like a cow!
Each tile should have a "Walkable" property. If the character is on tile 2,3 (x,y) and the player is trying to move him to the right (3,3) then test that tile for walkability. If it''s walkable move the character, otherwise don''t.
7|-|3 p057 @b0v3 i5 c3/^7i|=i3|) 1337!100|< |=0/^ j||3|/|7
yep, what i ment too in my last post...
How appropriate, you fight like a cow!
So should each tile be an instance of a structure which has propertys in it. If so, won''t that make a hell of a lot of instances.
I'll Be Back
how would this be done if your moving one pixel at a time?

This topic is closed to new replies.

Advertisement