|
@@ -15,8 +15,9 @@ void Game::tick() {
|
|
|
player.preTick();
|
|
|
if(physicsToggle) {
|
|
|
|
|
|
+ std::cout << controller.a.getDownTime() << "\n";
|
|
|
if(controller.a.isDown() && player.onGround) {
|
|
|
- player.addForce(Vector2(0.0f, 70.0f));
|
|
|
+ player.jumpTicks = 10;
|
|
|
player.onGround = false;
|
|
|
}
|
|
|
if(controller.right.isDown()) {
|
|
@@ -25,6 +26,11 @@ void Game::tick() {
|
|
|
if(controller.left.isDown()) {
|
|
|
player.addForce(Vector2(-2.5f, 0.0f));
|
|
|
}
|
|
|
+ if(player.jumpTicks > 0) {
|
|
|
+ player.jumpTicks--;
|
|
|
+ player.addForce(Vector2(0.0f, 10.0f));
|
|
|
+ }
|
|
|
+ player.jumpTicks *= controller.a.isDown();
|
|
|
|
|
|
player.addForce(Vector2(-player.velocity[0] * 0.5f, 0.0f));
|
|
|
} else {
|