Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Sprite collision - best?!?!?!?!?!?

Author
Message
famdylan
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location:
Posted: 1st Feb 2005 11:09
Okay I have posted some stuff here and its pretty quiet but i'll try this.

I have been looking over pizzamans example of collision and read most of the posts on this forum about collision and I still cant seem to figure out the best way to go. I got the concept, check to the sides/top/bottom of the thing you are moving and if it has a tile then dont let it go there. My problem is deciding which way to go to make ramps and non block shaped areas to move into. Do I go with small tiles (and many more of them) or is there someway to check colision that may not be pixel perfect but would suffice with out having to map every point on my character sprite?
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 1st Feb 2005 19:10
Each tile that you collide with should be held in an array like....

Map(50,50) = 1

So you can collide with this part of your screen. It would be like a tile 32*32.

Your sprite should move around, and maybe check 8 points as it moves. Top Centre, Bottom Centre, Left Centre, Right Centre, Top Left, Top Right, Bottom Left, Bottom Right. This arrangement can be made into a square, or a circle, or to fit the shape of your sprite outline. It allows your sprite to move freely. Then you just need to check the tiles nearest to your sprite, and ignore all of the others.

So check the map coordinate for the eight points.

famdylan
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location:
Posted: 1st Feb 2005 22:31
okay that makes sense and that is what I am doing for the most part. Here is my next question I am trying to make this somewhat generic of an engine so I can have tons of maps with different size tiles and different size characters. Here is my plan divde the height of the character by the height of the tiles and figure out how many points on each side I would need to check so that the collision detection doesnt let the character slide through between check points and do the same for the top and bottom.

Now how do I do I make this work with ramps and odd shaped tiles so it doesnt look like I am floating or is that a different method of detecting collision?
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 1st Feb 2005 23:10
You are allowed a few sprite collision routines before the game slows down. I'd use a few sprites for accurate collision. There is a dll somewhere for perfect sprite collision. Soon DBPro will have this feature anyway. DB Classic already has accurate sprite collision. So you have the accurate sprite collision on top of the tile map collision.

famdylan
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location:
Posted: 2nd Feb 2005 03:09
When you say accurate sprite collision what do you mean? -

My character is an animated sprite with a bright pink background can I tell it somewhere to ignore the background and use the other colors of that sprite for colision

Just want to figure out a way so my character doesnt get hung on the tiles I am using which tend to be smaller than the character
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 2nd Feb 2005 05:12
You can make a sprite background colour transparent. You can then collide with the other colours, and ignore the background colour. But you need a DLL to do that, unless you use DB Classic.

Pink is not a good background colour, Even if you make it transparent, you will have some pink AA around your sprite.

famdylan
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location:
Posted: 2nd Feb 2005 06:05
Okay whats a good color to use? Green? Blue?

Where can I find a DLL to do what you are saying - Does Nuclear Glory do that?

Login to post a reply

Server time is: 2025-05-19 13:31:56
Your offset time is: 2025-05-19 13:31:56