# On Sprite overlaps (with array of tiles) at location

**URL:** <https://forum.makecode.com/t/on-sprite-overlaps-with-array-of-tiles-at-location/11073>\
**Category:** Help\
**Created:** [November 25, 2021, 5:40pm UTC](https://forum.makecode.com/t/on-sprite-overlaps-with-array-of-tiles-at-location/11073 "2021-11-25T17:40:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Barry-Williams](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/barry-williams/32/5394_2.png) [@Barry-Williams](https://forum.makecode.com/u/Barry-Williams)\
**Post date:** [November 25, 2021, 5:40pm UTC](https://forum.makecode.com/t/on-sprite-overlaps-with-array-of-tiles-at-location/11073/1 "2021-11-25T17:40:34Z")

</div>

So I have noticed my students often use several of these blocks (

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/b/b48f2c796e07f89e50e3b046ed392221c05fe11e.png)  
caption:  
on Sprite of kind Player overlaps with at location

with the same code in them. I would like to create an array with the appropriate tiles (I can do this) and insert the array in place of the single tile (this does not work). This would be much better practice for my students and stop them needing to update their code in several locations.

---

<div class="post-metadata">

**Author:** ![thegreatone](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thegreatone/32/5414_2.png) [@thegreatone](https://forum.makecode.com/u/thegreatone)\
**Post date:** [November 28, 2021, 11:07pm UTC](https://forum.makecode.com/t/on-sprite-overlaps-with-array-of-tiles-at-location/11073/2 "2021-11-28T23:07:59Z")

</div>

Your students can define a function and call the function in all those blocks so that your students can edit one function and all of it changes.
