I finished the player physics lab, and while it’s still rough around the edges, I think it’s a good place to stop for now. There are a lot of things to keep track of code-wise, but I think I was able to get a hold of it eventually.
I was able to add a double-jump (although there’s likely a better way) and here’s how I went about it:
![](https://openlab.bmcc.cuny.edu/mmp-270-fall-2021/wp-content/uploads/sites/1770/2021/11/InkedScreenshot-2021-11-07-174822_LI.jpg)
![](https://openlab.bmcc.cuny.edu/mmp-270-fall-2021/wp-content/uploads/sites/1770/2021/11/InkedScreenshot-2021-11-07-175344_LI-1024x955.jpg)
![](https://openlab.bmcc.cuny.edu/mmp-270-fall-2021/wp-content/uploads/sites/1770/2021/11/InkedScreenshot-2021-11-07-175303_LI.jpg)
The jump_count resets every time you touch the ground.
And 1 is subtracted from jump_count everytime you jump.
So, here is everything together. I also added the arm to the player (doesn’t follow the mouse yet) and changed how gravity and jump height is calculated so I could get more consistent jumps.
Thanks!