# How to make pushable sprites using blocks?

**URL:** https://forum.makecode.com/t/how-to-make-pushable-sprites-using-blocks/11912
**Category:** Help
**Created:** [January 27, 2022, 5:40pm UTC](https://forum.makecode.com/t/how-to-make-pushable-sprites-using-blocks/11912 "2022-01-27T17:40:37Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![shenshan](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@shenshan](https://forum.makecode.com/u/shenshan)
#### Post date: [January 27, 2022, 5:40pm UTC](https://forum.makecode.com/t/how-to-make-pushable-sprites-using-blocks/11912/1 "2022-01-27T17:40:37Z")

</div>

I’m completely stuck **;-;**

I’m trying to figure out how to make my sprite “push” another sprite (such as a box or boulder) while walking into it.

---

<div class="post-metadata">

### Author: ![personalnote](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/personalnote/32/31359_2.png) [@personalnote](https://forum.makecode.com/u/personalnote)
#### Post date: [January 28, 2022, 5:06pm UTC](https://forum.makecode.com/t/how-to-make-pushable-sprites-using-blocks/11912/2 "2022-01-28T17:06:52Z")

</div>

set (mysprite) friction to -() from the sprites category, I think. It might be the other way around, so set (mysprite) friction to ()

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [January 28, 2022, 11:42pm UTC](https://forum.makecode.com/t/how-to-make-pushable-sprites-using-blocks/11912/3 "2022-01-28T23:42:51Z")

</div>

Here’s an example of pushing a block with tilemaps:

> **[move tile](https://arcade.makecode.com/26972-53783-74220-81533)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

I was having fun with this concept, so here is another much, much, much more complicated example that lets you push multiple blocks at a time:

> **[move multiple tiles](https://arcade.makecode.com/89673-71336-00766-29346)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![toxic\_lj](https://avatars.discourse-cdn.com/v4/letter/t/57b2e6/32.png) [@toxic\_lj](https://forum.makecode.com/u/toxic_lj)
#### Post date: [September 4, 2024, 6:35pm UTC](https://forum.makecode.com/t/how-to-make-pushable-sprites-using-blocks/11912/4 "2024-09-04T18:35:45Z")

</div>

Is there a way to make this for a top-down game without gravity and being able to push it left right up and down?

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [September 4, 2024, 7:19pm UTC](https://forum.makecode.com/t/how-to-make-pushable-sprites-using-blocks/11912/5 "2024-09-04T19:19:16Z")

</div>

@toxic_lj sure! something like this?

> **[tile-push-example](https://arcade.makecode.com/54150-65363-53169-57848)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

There are comments in that project that explain the code

---

<div class="post-metadata">

### Author: ![toxic\_lj](https://avatars.discourse-cdn.com/v4/letter/t/57b2e6/32.png) [@toxic\_lj](https://forum.makecode.com/u/toxic_lj)
#### Post date: [September 5, 2024, 4:38pm UTC](https://forum.makecode.com/t/how-to-make-pushable-sprites-using-blocks/11912/6 "2024-09-05T16:38:27Z")

</div>

Yes! Thank you so much

---

<div class="post-metadata">

### Author: ![ADM\_F](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/adm_f/32/19808_2.png) [@ADM\_F](https://forum.makecode.com/u/ADM_F)
#### Post date: [September 5, 2024, 8:30pm UTC](https://forum.makecode.com/t/how-to-make-pushable-sprites-using-blocks/11912/7 "2024-09-05T20:30:57Z")

</div>

yea thats a way better way then what i did Also i noticed that you cant push more then 1 Box at a time ive been trying to get that to work in my game for a while mind if you help me?

> **[Crate Dungeon Mid update](https://arcade.makecode.com/08485-14204-98069-29780)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [September 5, 2024, 8:50pm UTC](https://forum.makecode.com/t/how-to-make-pushable-sprites-using-blocks/11912/8 "2024-09-05T20:50:23Z")

</div>

pushing more than one block at a time is only slightly more complicated. basically, you want to scan for pushable tiles in the direction the push is happening and see if the line of pushable tiles ends in an empty spot or not.

here is that same sample code updated so that you can push more than one block

> **[multiple-tile-push-example](https://arcade.makecode.com/74334-08978-89383-74498)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![CodeOnTheCob](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeonthecob/32/19306_2.png) [@CodeOnTheCob](https://forum.makecode.com/u/CodeOnTheCob)
#### Post date: [February 9, 2025, 12:15am UTC](https://forum.makecode.com/t/how-to-make-pushable-sprites-using-blocks/11912/9 "2025-02-09T00:15:37Z")

</div>

sonic blaston made an extension for this

---

<div class="post-metadata">

### Author: ![shenshan](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@shenshan](https://forum.makecode.com/u/shenshan)
#### Post date: [March 14, 2025, 5:16pm UTC](https://forum.makecode.com/t/how-to-make-pushable-sprites-using-blocks/11912/10 "2025-03-14T17:16:10Z")

</div>

I’ve recently come back to Makecode, thank you so much for your help! Looking forward to working on this again.
