2 Added why this logic is a mistake
source | link

I would think the logic should be a loop up to the peek jump point like so:

if(Keyboard.GetState().IsKeyDown(Keys.Space) && !jumping) {
    float peek = 64f;
    while(_position2D.Y != peek) { _position2D.Y += 1; }
}

Personally, and this is just me, I would move the variable peek out to a more publicly accessible point so that it can be easily edited/referenced. That is just me though.

[edit] As pointed out in the comments, this might seem like good logic at first glance, but is made of fail in practice, for the reasons attached to the comments. I'm leaving this here for those wanting to learn from my uber mistake =D

I would think the logic should be a loop up to the peek jump point like so:

if(Keyboard.GetState().IsKeyDown(Keys.Space) && !jumping) {
    float peek = 64f;
    while(_position2D.Y != peek) { _position2D.Y += 1; }
}

Personally, and this is just me, I would move the variable peek out to a more publicly accessible point so that it can be easily edited/referenced. That is just me though.

I would think the logic should be a loop up to the peek jump point like so:

if(Keyboard.GetState().IsKeyDown(Keys.Space) && !jumping) {
    float peek = 64f;
    while(_position2D.Y != peek) { _position2D.Y += 1; }
}

Personally, and this is just me, I would move the variable peek out to a more publicly accessible point so that it can be easily edited/referenced. That is just me though.

[edit] As pointed out in the comments, this might seem like good logic at first glance, but is made of fail in practice, for the reasons attached to the comments. I'm leaving this here for those wanting to learn from my uber mistake =D

1
source | link

I would think the logic should be a loop up to the peek jump point like so:

if(Keyboard.GetState().IsKeyDown(Keys.Space) && !jumping) {
    float peek = 64f;
    while(_position2D.Y != peek) { _position2D.Y += 1; }
}

Personally, and this is just me, I would move the variable peek out to a more publicly accessible point so that it can be easily edited/referenced. That is just me though.