I understand it'd be pretty difficult to help me with a problem with me just describing it, without seeing code so...
http://skynes.tripod.com/TheWizard.zip
There's a link to a zip file containing my XNA project and all images.
The Project so far is a mix of a couple of tutorials I found online (2d wizard and a tile engine) along with sprites I found online. I haven't made any of my own sprites yet cause I don't see the point until I have everything working, but I will be using all my own original sprites when it works.
Anyway.
So far it's a wizard who can jump and shoot fireballs. An enemy (movement currently commented out) walks across the screen, firballs dont do anything yet, but touching the enemy costs you a life.
My problem is with the platforms. I can jump onto the platforms ok, but if you jump while on the platforms you end up hanging in mid-air. I've tried incorporating a gravity effect, so when you move off the platforms you fall, but I haven't had any luck with it. In all honesty I really don't have a clue how to make gravity function using what I've got.

2d Platforms
Ant_59
Whenever you need to move the object, give it a velocity in the direction you want to move in. For example:
if(IsKeyDown(Keys.Right)
Wizard.Velocity.X = 5;
if(IsKeyDown(Keys.Left)
Wizard.Velocity.X = -5;
// And the same for Up and Down using Y instead of X.
When it comes time to update the position of the Wizard, just do:
Wizard.Position += Wizard.Velocity;
That'll move the Wizards position by it's velocity. So if you have -5 X and +3 Y, he'll move 5 to the left and 3 up.
Now if you want to add gravity, just add to his Y velocity every frame. This will constantly give him movement downwards.
Wizard.Velocity.Y += 2;
if(Wizard.Velocity.Y > 20)
Wizard.Velocity.Y = 20; // Don't want him rocketing at the speed of light if he's been falling for a long time.
That should help you get him off of the platform and it'll more accurately represent jumps (jump up fast, then slow down a bit, then begin to fall).
Hope this helps!
ray_newbie_SSIS
The program spans multiple methods, I have the full thing at www.skynes.tripod.com Second on the list, the Wizard but with gravity.
I actually don't think it's the gravity method. I've commented out the application of gravity and he still didn't jump.
Moving left and right works, so in the Keyboard.right/left bit I tried adjusting the Y velocity by -40, with no gravity enforced. Technically that should send him flying to the top of the screen, but it didn't. He still didn't move.
This is what is odd. Moving left and right works grand using mwizard.velocity but when I try to make an up or down motion, it does nothing.
AlexBB
I'm on a Plataform project as well, and I've decided to add some simple elements of physics to the game, being the goal to actually write a small physics engine because I have had trouble trying to use FarSeer's Physics Engine and another one I found out there. I still have A LOT of work to do, but I'll give you a grasp of the concepts of which might be interesting to you:
Force = mass * acceleration
mass is a scalar value, every sprite should have one.
both force and acceleration are vectors, so that is easy to implement.
Your player may have 80kg and gravity may be 9.8m/s^2 so each call to update in your game you get to calculate gravity for him.
As far as movement, you can add to his final position a velocity vector like Grozzler put it.
player input + gravity = player position
then comes the floor problem, since floors have to stop you from going down, they need to be pushing you up in the same ammount gravity pulls you down, so for that you will need normals. but I guess if you dont want to mess around there, and have specific Y values for your plataforms, you can just do
if( player.position.Y == value ) {stop gravity}
Anyway, Id recommend checking codeplex for some XNA components, if you know how to use them into your game. Good Luck!
De_Vaddrr
Mass is 80.
Gravity is 9.
I divide the total by 120 to get a more reasonable value. So in this case my gravity is 6. I will be playing with my values in the future, so divide by 120 is only to get a smaller number, otherwise I'm forced to have a jump value of a couple of thousand.
The jump force is -40
private void ApplyGravity(){
mWizard.Velocity = new Vector2(mWizard.Velocity.X, mWizard.Velocity.Y + grav.GetVelocity(mWizard));
mWizard.Position = new Vector2(mWizard.Position.X + mWizard.Velocity.X, mWizard.Position.Y + mWizard.Velocity.Y);
}
//Within jump code
mWizard.Velocity = new Vector2(0, -40);
Sorry, I don't know what this forums procedure on posting code extracts is.
Duncan Stewart
Everything so far has been a great help and given me a good idea of what to do.
I'm going to go and re-write how movement works to use velocity and gravity rather than what it was.
I'll get back to you on what works and what doesn't.
thanks.
[Edit]
As odd as it is with playing with physics. Adding gravity, which forced me to change how all the movement worked actually made it all simpler and easier for me to understand!
I have the next version as www.skynes.tripod.com
my newest problem is that I won't jump anymore. My movement left and right is fine, works as intended. My jump looks like hes jumping, as in, the sprite changes through the jump pattern. But his feet never leave the ground.
I set the jump speed to -40, but it never jumps.
franziss
mobigital
Marcus Rodrigues
I couldnt download your sourcecode, I might take a look at it if you can provide a reliable link. :)
how do you make him jump
is the gravity taking over the jump impulse
are you constantly adding up vectors for gravity or jump at each update (giving acceleration - change in velocity over time)
AdeptBlue
{
{
Sassie
Link is working for me now. Haven't had a chance to look at it yet though.
edit: looks like there's a problem with jumping. Once I get on the platform I can't get down.
I also managed to jump and stay near the top of the window. 
George - I emailed the zip to you.
Andrew Buyan
1: http://xna.multigan.com/pastebin/ page=view&id=1172197702
2: http://xna.multigan.com/pastebin/ page=view&id=1172197909
The first link is a class for a fighter (in your case a wizard). In your constructor, you want a Position, Velocity, Mass, and Gravity. This is basic physics. You have two methods really. You have your move method which updates the position:
Final Position = Initial Position + (Velocity*Change in Time)
Update the velocity, which in this case, you only want to worry about gravity and not the horizontal velocity:
Velocity = Velocity - (Mass*Gravity)
This is not the way you would learn it in physics class...kinda. It is really Distance/Time.
Then you have the Jump method. You want to send an "impulse" into your velocity to "spring" you upwards.
Velocity = -450 (I just chose 450 as an example...)
The reason why I have a negative number is because the way XNA has things oriented and *** or something like that.
In the other class, which is basically your game class (in my case, it is the fighting screen) you have a method which I called checkBorders(). When you are on the ground you want to have 0 Velocity (so you don't move) and you don't want to go through the ground or the roof, so that's why I put those there.
If there are any questions just ask in this thread, I'll check it over the next couple of days. After that, eh...
LauraCapatina
[Edit: Link works if I right click and Save As in Firefox. If I click it, it doesn't work so all is well]
[Edit: Nix that. Link still doesn't work. File downloaded has no data. So the link still doesn't work for me.]
jayaraja
Durrrr... me skynes... me do daft fings... durrrr...
Tripod doesnt allow remote access... I shoulda remembered that.
try http://skynes.tripod.com on its own. Link should be there and since it's from inside the site, it should allow downloads also.
Sondre - MSFT Regional Director
Got a suggestion for where I can put the project
I make him jump by adding a negative value to his Y velocity. Then doing wizard.position += wizard.velocity
I have commented out the gravity, so the gravity will not affect his jump, yet his jump still doesn't jump.