PDA

View Full Version : Help with collision handling!!



XTRiZ
27-01-2005, 10:26 PM
Hi, i'm having some problems with my collisionhandling..

I have pixelperfect collisiondetection between the ground and my sprite, but really have no idea how to make my sprite walk upward or downward a hill, i can make it a hill in a specifik angle and walk it upward or downward with some special tile propertys but how to make my sprite walk upward the hill with pixelperfect collisiondetection?

I hope anyone understand what i'm talking of here :shock:

X

Traveler
28-01-2005, 07:34 AM
Sofar my experience with platformgames are limited to horizontal tiles only, but I think it isn't all that different. I take it you're checking for tile properties when you land on a tile? You could make a tileproperty 'angular'. In which case you use different animations for walking upwards, and of course you add an upwards movement when moving left/right.

I can't offer any code or samples, however there's a guy on the omega forums working on a game with angular tiles as well, perhaps you can ask him for more details: http://www.delphisanctuary.com/forums... (http://www.delphisanctuary.com/forums/viewtopic.php?t=485)

XTRiZ
28-01-2005, 07:49 AM
Since my project is made with Omega i've already been there, and yes i can do it with "angular tiles" but i would like to have some "irregular hills" also not just straight one. It was a couple of days since i last worked on it, but i thought of getting some hints from some more experianced game-makers..

X

Traveler
28-01-2005, 08:46 AM
Ah ok, well irregular tiles are whole different story. It would require a lot of checks, on the pixel level, which could affect your game speed quite a bit. In any case there's a CollisionDemo_2 in the omega package which may be of some help. It shows a collision check, with a pixel following the surroundings of the collided object. Exchange the pixel with your sprite, the arrow with your hills and you're well underway.

Paulius
28-01-2005, 08:50 AM
You could approximate you're map's contour with vectors and if anything collides with them push that object in the direction of their normals.

XTRiZ
28-01-2005, 10:12 AM
doh, i missed that example. I'll have a look at it later.

That vector stuff sounds intresting, i'll have to dig some more thou.

Thanks for the quick answers..

X