Original from ( C++ Fundamentals: Game Programming For Beginners )
2 Likes
Wow this is incredible!!
1 Like
Great job!
1 Like
Cool Scarfy mod.
Has anyone else noticed that sometimes Scarfy goes a few pixels lower after jumping? Heβs not always on the ground. Before the double jump was removed from this project you could make the rectangle go very high and it had enough force it could be driven all the way below the window.
1 Like
I think is due to the delta time.
If we run game in my case the start of βyβ position is 472
when i hit jump and landing on the groud:
So to fix that we can simple use:
// jumping pos
if (velocity == 0)
{
scarfyData.pos.y = windowDemensions[1] - scarfyData.rec.height;
}
else
{
scarfyData.pos.y += velocity * dt;
}
1 Like