View Single Post
  #3  
Old 03-31-2005, 02:05 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Well, I'm mostly thinking about vehicles. Like one time I was coding a car for Era, and it had sprites for sixteen different directions. I wanted to add a nice physics system too, but that required some very precise collision detection. If we were just dealing with tiles then it wouldn't be so bad, but I also have to consider players and weird-shaped NPCs and suchlike.

So, what're my options? The best approach I can imagine is to treat the car as a rectangle and divide it into four sides, and then figure out when each of them will intersect with other stuff in the level. But the only precise way to do that is to iterate through every pixel, or build up a geometrical summary of the shape of the level. In either case, it'd be much faster and easier if hardcoded.

Check out the image I attached. It gives a basic summary of my problem.
Attached Thumbnails
Click image for larger version

Name:	car.PNG
Views:	318
Size:	6.1 KB
ID:	31520  
__________________
Reply With Quote