# How can i calculate margin?

**URL:** <https://forum.makecode.com/t/how-can-i-calculate-margin/27180>\
**Category:** Help\
**Tags:** graphics-and-math\
**Created:** [February 22, 2024, 5:40pm UTC](https://forum.makecode.com/t/how-can-i-calculate-margin/27180 "2024-02-22T17:40:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![YuminCoding](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/yumincoding/32/11482_2.png) [@YuminCoding](https://forum.makecode.com/u/YuminCoding)\
**Post date:** [February 22, 2024, 5:40pm UTC](https://forum.makecode.com/t/how-can-i-calculate-margin/27180/1 "2024-02-22T17:40:52Z")

</div>

Hey there, i have a big news, we’re making an revolution of the FNF in the makecode arcade.  
But i need to calculate margin of y position from sprite.  
can you help me guys?

 ![스크린샷 2024-02-21 오후 12.44.40](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/4/44963f33213958e5f81c4b2a6535d0a1ffdd3504.jpeg)  
An Full code what i made last.

---

<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:** [February 23, 2024, 7:28pm UTC](https://forum.makecode.com/t/how-can-i-calculate-margin/27180/2 "2024-02-23T19:28:33Z")

</div>

What exactly do you mean? Like checking if one sprite overlaps with another? There are blocks for that. You don’t need a bunch of math. The blocks should be in the sprite section. Just scroll down or search for “overlaps” or something. I think the block is called  
On (Sprite) of kind (sprite kind) overlaps (othersprite) of kind (sprite kind)  
Hope this helps!

---

<div class="post-metadata">

**Author:** ![YuminCoding](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/yumincoding/32/11482_2.png) [@YuminCoding](https://forum.makecode.com/u/YuminCoding)\
**Post date:** [February 26, 2024, 6:54pm UTC](https://forum.makecode.com/t/how-can-i-calculate-margin/27180/3 "2024-02-26T18:54:59Z")

</div>

Yes this helps. thanks to help this!
