# Dropthrough Tiles

**URL:** <https://forum.makecode.com/t/dropthrough-tiles/20797>\
**Category:** Game Design\
**Tags:** graphics-and-math, extension\
**Created:** [June 23, 2023, 8:31pm UTC](https://forum.makecode.com/t/dropthrough-tiles/20797 "2023-06-23T20:31:17Z")\
**Posts on this page:** 6\
**Page:** 1

<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:** [June 23, 2023, 8:31pm UTC](https://forum.makecode.com/t/dropthrough-tiles/20797/1 "2023-06-23T20:31:17Z")

</div>

I have perfected dropthrough tiles, it is actually pretty simple.

> **[dropthrough](https://arcade.makecode.com/49420-98795-19474-46666)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

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)

 ![Screen Shot 2023-06-23 at 12.00.32 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/b/b10a0003f6277ba7db7d629cfa2ddae624b5250e.png)  
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**
>
> ```auto
> game.onUpdate(function () {
> for (let value of tiles.getTilesByType(sprites.swamp.swampTile2)) {
> if (mySprite.y + mySprite.image.height / 2 <= value.top && !(controller.down.isPressed())) {
> tiles.setWallAt(value, true)
> } else {
> tiles.setWallAt(value, false)
> }
> }
> })
> 
> ```
> 
> make sure to change the sprite name and the tile.

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [June 26, 2023, 7:40pm UTC](https://forum.makecode.com/t/dropthrough-tiles/20797/2 "2023-06-26T19:40:39Z")

</div>

Can’t you access the height of the image natively? Using the ‘get property’ block?

 ![arcade-screenshot (5)](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/4/41e5acc48120fad53027a836c900a3f7f5a84a9a.png)

---

<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:** [June 26, 2023, 7:43pm UTC](https://forum.makecode.com/t/dropthrough-tiles/20797/3 "2023-06-26T19:43:15Z")

</div>

Lol i guess i didn’t see that

---

<div class="post-metadata">

**Author:** ![Brainstorm\_Studios](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brainstorm_studios/32/20476_2.png) [@Brainstorm\_Studios](https://forum.makecode.com/u/Brainstorm_Studios)\
**Post date:** [July 13, 2023, 4:36pm UTC](https://forum.makecode.com/t/dropthrough-tiles/20797/4 "2023-07-13T16:36:06Z")

</div>

so, after playing around with this in my own game, i stumbled upon a much, **much** less convoluted way to make fallthrough platforms. here’s a simplified version.  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/d/d558a910900d10a9d9ca5bee6a75e71354c26cd2.png)  
hope this helps!

---

<div class="post-metadata">

**Author:** ![Catz\_N\_Coffee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/catz_n_coffee/32/15323_2.png) [@Catz\_N\_Coffee](https://forum.makecode.com/u/Catz_N_Coffee)\
**Post date:** [May 19, 2024, 3:56pm UTC](https://forum.makecode.com/t/dropthrough-tiles/20797/5 "2024-05-19T15:56:30Z")

</div>

is it okay if i use this code in my games

---

<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:** [May 20, 2024, 1:28am UTC](https://forum.makecode.com/t/dropthrough-tiles/20797/6 "2024-05-20T01:28:27Z")

</div>

absolutely!
