Sep 16, 2009 at 5:06 PM
Edited Sep 16, 2009 at 5:08 PM
Hello, i've been using farseer to develope a project of mine. I must say, it's bloody awesome, and i am deeply impressed.
Recently i have been going at jump code. Previously, when i used my own physics code, i would check to see if there was collision with the bottom of the player's hitbox. If so, the player has the option to jump. I do not know how to do this quite yet in
farseer, though i do know it is quite possible i just am unable to determine the inner workings of it easily.
I am looking for something like
if (playerGeom.OnCollision(playerGeom, geomList, ContactList contactList)
if (gamePad1.DPad.Up == ButtonState.Pressed ||
player1.ApplyImpulse(new Vector2(0, -jumpSpeed));
However, playerGeom.OnCollision is a function not a bool.
I need something that would check to see if collides with any brush in my list of geoms, created when i load my map. However, this would probably allow the player to jump whenever it collides on any side with the map geometry. My guess says the player will
be able to walljump (cool, but not what i want). Is there a way to detect collision based on certain sides of a geom? or within certain vertices?