# Jumping up through platform and landing on it

**URL:** <https://forum.makecode.com/t/jumping-up-through-platform-and-landing-on-it/30309>\
**Category:** Help\
**Created:** [August 26, 2024, 4:34pm UTC](https://forum.makecode.com/t/jumping-up-through-platform-and-landing-on-it/30309 "2024-08-26T16:34:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![teach421](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/teach421/32/12978_2.png) [@teach421](https://forum.makecode.com/u/teach421)\
**Post date:** [August 26, 2024, 4:34pm UTC](https://forum.makecode.com/t/jumping-up-through-platform-and-landing-on-it/30309/1 "2024-08-26T16:34:11Z")

</div>

Have a student who wants their character to be able to jump up through a platform on screen from underneath, and then land on it. I was able to get the basic interaction working by saying "If the tile above the player is THIS tile (a specific tile for the platform), then set the wall flag to off on the tile above the player. AND Elif the tile below the player is THIS tile (same specific tile), then set the wall flag to on on the tile below the player.  
That DOES work. However, we run into issues when the sprite is between two tiles. If they aren’t perfectly centered beneath the tile when they jump up, it won’t let them pass through.

Can anyone think of how I can modify it so that it will also allow pass through if the tile to above and to the left or right is the same tile as well as the one above, then it will turn the wall flag off for those tiles? Or I guess if the tile above the player is that specific tile, to turn off the wall flag on all three tiles, above, above to the right and above to the left? And then turn them back on?

Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![not\_a\_lemon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/not_a_lemon/32/35289_2.png) [@not\_a\_lemon](https://forum.makecode.com/u/not_a_lemon)\
**Post date:** [August 26, 2024, 5:20pm UTC](https://forum.makecode.com/t/jumping-up-through-platform-and-landing-on-it/30309/2 "2024-08-26T17:20:42Z")

</div>

try this!

 ![Screenshot 2024-08-26 10.12.25 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/1/4/146844ee72c2ad05994a6d5bab36ff6283da978a.png)

---

<div class="post-metadata">

**Author:** ![teach421](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/teach421/32/12978_2.png) [@teach421](https://forum.makecode.com/u/teach421)\
**Post date:** [August 26, 2024, 6:45pm UTC](https://forum.makecode.com/t/jumping-up-through-platform-and-landing-on-it/30309/3 "2024-08-26T18:45:51Z")

</div>

Oh, that’s interesting. I like the approach. One question tho… if I’m reading htis right, it’s going to set ALL platform tiles above the player to lose their wall status, and as soon as the character moves high enough, will turn the wall on.

Won’t that prevent the student from setting enemies on any platforms above the player?

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [August 26, 2024, 8:32pm UTC](https://forum.makecode.com/t/jumping-up-through-platform-and-landing-on-it/30309/4 "2024-08-26T20:32:49Z")

</div>

You should be able to use the “tilemap location of (mySprite)” block in the Scene tab to get the tilemap position of your player sprite, then you can use the Set Wall block to (if they are that type of tile) set the walls Off of the three tiles above the player. The main problem is how to turn the walls back on. I think one solution would be to set wall On for all of those blocks that are below the player, and the pass-through script could run only when the player jumps. Then, to make sure no walls get left off, you could have a script to turn all walls On whenever the player is hitting the ground (when their Velocity Y = 0) just to resolve any edge cases.

---

<div class="post-metadata">

**Author:** ![not\_a\_lemon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/not_a_lemon/32/35289_2.png) [@not\_a\_lemon](https://forum.makecode.com/u/not_a_lemon)\
**Post date:** [August 27, 2024, 12:57am UTC](https://forum.makecode.com/t/jumping-up-through-platform-and-landing-on-it/30309/5 "2024-08-27T00:57:42Z")

</div>

oh yeah, didn’t think of that. you could do something like this:

> **[Untitled](https://arcade.makecode.com/S94516-91015-00507-71998)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

it’s a bit buggy, and isn’t actually very good, but I’ve never done enemies on semisolid ground.

---

<div class="post-metadata">

**Author:** ![Brohann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brohann/32/17380_2.png) [@Brohann](https://forum.makecode.com/u/Brohann)\
**Post date:** [August 28, 2024, 12:47am UTC](https://forum.makecode.com/t/jumping-up-through-platform-and-landing-on-it/30309/6 "2024-08-28T00:47:10Z")

</div>

> [@Dropthrough Tiles](https://forum.makecode.com/t/dropthrough-tiles/20797):
>
> I have perfected dropthrough tiles, it is actually pretty simple. you can press down to drop through it. I didn’t want to code a new movement engine, so I just copied one of my other games, [Tower of Anger](https://arcade.makecode.com/S05689-22532-39014-65727) you will need to go into javascript to get mySprite.image.height, but you can also just take it out and set to your players height in pixels 
> 
> > **java code that you can copy and paste**
> >
> > game.onUpdate(function () { for (let value of tiles.getTilesByType…

you might want to read this thread

---

<div class="post-metadata">

**Author:** ![teach421](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/teach421/32/12978_2.png) [@teach421](https://forum.makecode.com/u/teach421)\
**Post date:** [August 28, 2024, 12:50am UTC](https://forum.makecode.com/t/jumping-up-through-platform-and-landing-on-it/30309/7 "2024-08-28T00:50:12Z")

</div>

While it might be a bit buggy still, I think I’ve got something that will work well for this student! Appreciate both of you sharing your suggestions!

---

<div class="post-metadata">

**Author:** ![not\_a\_lemon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/not_a_lemon/32/35289_2.png) [@not\_a\_lemon](https://forum.makecode.com/u/not_a_lemon)\
**Post date:** [August 28, 2024, 1:16am UTC](https://forum.makecode.com/t/jumping-up-through-platform-and-landing-on-it/30309/8 "2024-08-28T01:16:17Z")

</div>

glad i could help 😁
