Archived

This topic is now archived and is closed to further replies.

Guest Anonymous Poster

Bounding Box Tile detection

This topic is 6655 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello!

Well, in fact I didnt understand very well :/
I'm not sure if I will be able to help (as Im not very good in programming), but I love to see which kind of problems do ppl have, so if (er, when) I have the same problems I know how to fix, and I love games of isometric view, and I try to make them, so I have a good chance of having same problems as other iso games programmers :P

Cya,
-RoTTer

Share this post


Link to post
Share on other sites
There's really no point drawing a circle using the full 360 degrees. A circle is symmetrical in all angles, so the fastest thing to do is to break a circle into octants, eight parts. Calculate the arc for one octant, and flip it around the x and y axis for all the other portions. There is some code that explains octants here but it might be a bit confusing.. there are other samples all over the place..

Make sure you use the lPitch member of the data returned from a DDSURFACE->Lock() call, not the assumed surface width (640, 800, etc) or else it'll look wonky.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
This is only a few ideas, there are a number of ways to do this.

Most likely, you're going to need to store information seperate to the actual graphics of objects. In the case of a building, you could have perhaps a bounding polygon of some kind(a quadrilateral would do fine), or maybe some kind of mask for it, another graphic with only two colors, white or black, one of which tells where the building is, and one of which doesn't. That mask could be used for collision detection, or just to see whether or not you should draw over it.

There are a lot of ways to do this, and how you do it will pretty much depend on your own preferences, and what you need it for.

Good luck,
Jonathan

Share this post


Link to post
Share on other sites
hi,
Is your objects treated as a tile or as a
sprite object?
if it's a non square sprite object, you can
divide it into some squares at the same size
of your tiles, for exact collision detection
you can use a mask for your object or use
some other Pixel Precision Collision Detection Methods

As i've exprienced before, it's not noticable
for the player that you have used tile
precision or pixel precision for your
object borders,...

------------------
--Ali Seyedof (It's all dark !)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hi,

I am in the middle of programming a game using standard square tiles.

I need to know how can detect a non square object as part of the graphics, for example an isometric looking building, I want the building to be only detected around the edges not as part of the whole tile.

if anyone needs to know more please let me know my description is pretty vague.

Share this post


Link to post
Share on other sites