Platformer floor hit testing
Posted: Sun Dec 02, 2012 11:40 pm
Hi
I'm very new to games so I may have this all wrong. I'm playing with a platformer and have a character doing an nice walk left, stand, walk right animation and jump with gravity. The next thing I need to do is add some obstacles and platforms to jump to etc. I'm trying to work out the optimal way to hit test when the character has hit a side of an obstacle so I'm looking for ideas. Obviously we don't want to hit test on every obstacle on the level each move so I was wondering about creating an array or list of obstacles when the game starts and somehow filtering it to obstacles within a reasonable range of the character. Anyway... interested in ideas or methods on what is normally done.
One idea that occurs to me is designing the whole level in an image editor and then just using intersect on the level image. Probably not the best memory and processor wise but it sure would simplify the game design... I guess you could get the same thing by grouping all the obstacles and floor and using intersect on that... which would reduce memory use but not processing on the intersect.
Cheers
Monte
I'm very new to games so I may have this all wrong. I'm playing with a platformer and have a character doing an nice walk left, stand, walk right animation and jump with gravity. The next thing I need to do is add some obstacles and platforms to jump to etc. I'm trying to work out the optimal way to hit test when the character has hit a side of an obstacle so I'm looking for ideas. Obviously we don't want to hit test on every obstacle on the level each move so I was wondering about creating an array or list of obstacles when the game starts and somehow filtering it to obstacles within a reasonable range of the character. Anyway... interested in ideas or methods on what is normally done.
One idea that occurs to me is designing the whole level in an image editor and then just using intersect on the level image. Probably not the best memory and processor wise but it sure would simplify the game design... I guess you could get the same thing by grouping all the obstacles and floor and using intersect on that... which would reduce memory use but not processing on the intersect.
Cheers
Monte