# Disable more than 1 jump

**URL:** <https://forum.code.org/t/disable-more-than-1-jump/37536>\
**Category:** Coding and Debugging Help\
**Created:** [January 25, 2023, 1:10am UTC](https://forum.code.org/t/disable-more-than-1-jump/37536 "2023-01-25T01:10:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pluto](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/pluto/32/9141_2.png) [@pluto](https://forum.code.org/u/pluto)\
**Post date:** [January 25, 2023, 1:10am UTC](https://forum.code.org/t/disable-more-than-1-jump/37536/1 "2023-01-25T01:10:33Z")

</div>

I was trying to make a platformer for my friend and teach him of how to make a platformer, but I just can’t find a way to disable jumping more than once.

> **[Check out what I made](https://studio.code.org/projects/gamelab/E6F7oSjocy1VkV53JS1eF35ScWdv3GY8bmkk8F96p1g/view)**
>
> I wrote the code myself with Code.org

Pretty self-explanatory.

---

<div class="post-metadata">

**Author:** ![varrience](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/varrience/32/8042_2.png) [@varrience](https://forum.code.org/u/varrience)\
**Post date:** [January 25, 2023, 11:04am UTC](https://forum.code.org/t/disable-more-than-1-jump/37536/2 "2023-01-25T11:04:38Z")

</div>

Salutations @pluto,  
in regards to disabling more than 1 jump seems to be solved but the jumping still seemed inconsistent so i did a little tampering… hope you don’t mind

```auto
player.collide(ground);
  player.collide(leftEdge);
  player.collide(blocks);
  if (keyWentDown("up") && player.velocityY == 0) {
    player.velocityY = -6;
  }
  player.velocityY += 0.1;

```

i don’t know if this is a commonly unknown thing but… .collide() stops all velocity if it’s colliding against the correct object… by doing this we hit 0, then we look for that in the jump code… then continue applying gravity it seems a bit better now with that in the movement function

Best of luck on getting a platformer out!

---

<div class="post-metadata">

**Author:** ![pluto](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/pluto/32/9141_2.png) [@pluto](https://forum.code.org/u/pluto)\
**Post date:** [January 25, 2023, 1:53pm UTC](https://forum.code.org/t/disable-more-than-1-jump/37536/3 "2023-01-25T13:53:40Z")

</div>

It still doesn’t work.

---

<div class="post-metadata">

**Author:** ![varrience](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/varrience/32/8042_2.png) [@varrience](https://forum.code.org/u/varrience)\
**Post date:** [January 25, 2023, 7:12pm UTC](https://forum.code.org/t/disable-more-than-1-jump/37536/4 "2023-01-25T19:12:09Z")

</div>

Well… did you remove the other collisions from the draw() loop… you should also probably do that sorry if i didn’t make that obvious  
if your still unsure about what is wrong use this Link: [https://studio.code.org/projects/gamelab/PAk6X-9t5Yfbh6SX0IciWDa3hpSA8ASh-knWwgsP-Y0/view](https://studio.code.org/projects/gamelab/PAk6X-9t5Yfbh6SX0IciWDa3hpSA8ASh-knWwgsP-Y0/view) it was what i did originally to get your game running before

---

<div class="post-metadata">

**Author:** ![pluto](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/pluto/32/9141_2.png) [@pluto](https://forum.code.org/u/pluto)\
**Post date:** [January 26, 2023, 7:26pm UTC](https://forum.code.org/t/disable-more-than-1-jump/37536/5 "2023-01-26T19:26:34Z")

</div>

Alright, thanks for helping!
