How did older games do collision detection with walls, floors and ceilings?

后端 未结 4 1106
渐次进展
渐次进展 2020-12-13 04:55

I have been reading about collision detection in games on stackoverflow and other sites. A lot of them talk about BSPs, bounding elipses, integration etc. However, on the

4条回答
  •  抹茶落季
    2020-12-13 05:53

    For games such as Super Mario World (SNES), the game stored the levels in a memory format that made it easy to take Mario's X/Y location, convert it to a tile address, and then check the tiles immediately around that address. Since the levels were always a fixed width (though the area you could view varied), it made addressing easier to manage since it was always a fixed offset from mario's position, e.g. Address + 1 for the tile beside mario, Address + 0x300 for the tile below him, etc.

提交回复
热议问题