# Physics2D extension

**URL:** <https://forum.makecode.com/t/physics2d-extension/42516>\
**Category:** Arcade\
**Tags:** graphics-and-math, extension\
**Created:** [March 5, 2026, 7:24pm UTC](https://forum.makecode.com/t/physics2d-extension/42516 "2026-03-05T19:24:40Z")\
**Posts on this page:** 20\
**Page:** 1

<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:** [March 5, 2026, 7:24pm UTC](https://forum.makecode.com/t/physics2d-extension/42516/1 "2026-03-05T19:24:40Z")

</div>

I’m working on an extension, and I’m wondering what //%blockID is and what does it do. (@richard I’m mostly asking you but anyone else who knows too)

---

<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:** [March 5, 2026, 7:44pm UTC](https://forum.makecode.com/t/physics2d-extension/42516/2 "2026-03-05T19:44:35Z")

</div>

Also @richard how can I create a block like the Menu item in your Mini Menu Extension?

---

<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:** [March 5, 2026, 10:09pm UTC](https://forum.makecode.com/t/physics2d-extension/42516/3 "2026-03-05T22:09:53Z")

</div>

blockId is used internally by makecode. every block needs to have a unique block id  
as for the second question, can you be more specific? what feature are you looking to copy?

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [March 5, 2026, 10:54pm UTC](https://forum.makecode.com/t/physics2d-extension/42516/4 "2026-03-05T22:54:35Z")

</div>

well then why does every block have to have a block id like every one of my extensions i dont think i put //%blockId on them

---

<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:** [March 5, 2026, 10:56pm UTC](https://forum.makecode.com/t/physics2d-extension/42516/5 "2026-03-05T22:56:10Z")

</div>

I essentially want to have an array of “slope tiles”

I want to make each “slope” a block like this:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/1/4/140279c5286a815f34b46c4314e710a2bbfa6e09.png)  
But make it have a tile select, number input, and number input. How can I make it becomes a block if my code looks like this:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/3/e/3ea46d0295c5f52eb01386d6d99ad6a103ed0e92.png)

---

<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:** [March 10, 2026, 8:35pm UTC](https://forum.makecode.com/t/physics2d-extension/42516/6 "2026-03-10T20:35:31Z")

</div>

@richard ok i’ve figured this out but for some reason this is causing an error and I can’t figure out why. Please help:

> **[arcade-physics-2d](https://arcade.makecode.com/S17757-66772-68741-78278)**
>
> Uhhhhh idk what's happening

---

<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:** [March 11, 2026, 5:23pm UTC](https://forum.makecode.com/t/physics2d-extension/42516/7 "2026-03-11T17:23:17Z")

</div>

you’re never assigning your slopelist object.  
also, you probably need to set a tilemap before calling activateSlopeTiles

---

<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:** [March 12, 2026, 6:11pm UTC](https://forum.makecode.com/t/physics2d-extension/42516/8 "2026-03-12T18:11:59Z")

</div>

Okay, how can I assign it exactly? (sry I’m not very experienced with extension making)

---

<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:** [March 12, 2026, 6:34pm UTC](https://forum.makecode.com/t/physics2d-extension/42516/9 "2026-03-12T18:34:45Z")

</div>

when you declare the variable here:

```auto
let slopeList: SlopeTileList = null

```

you need to assign it to an instance of the class like so:

```auto
let slopeList: SlopeTileList = new SlopeTileList([])

```

---

<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:** [March 12, 2026, 7:33pm UTC](https://forum.makecode.com/t/physics2d-extension/42516/10 "2026-03-12T19:33:22Z")

</div>

Ah ok thank you! Does this mean that the `sprite.create()` function essentially creates a new `Sprite` class?

---

<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:** [March 12, 2026, 7:34pm UTC](https://forum.makecode.com/t/physics2d-extension/42516/11 "2026-03-12T19:34:18Z")

</div>

yup, the code for that is right here:

> <https://github.com/microsoft/pxt-common-packages/blob/master/libs/game/sprites.ts#L36>

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [March 12, 2026, 9:14pm UTC](https://forum.makecode.com/t/physics2d-extension/42516/12 "2026-03-12T21:14:22Z")

</div>

how do classes work along with the new thing because I would just proably use = null or something

---

<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:** [March 12, 2026, 10:35pm UTC](https://forum.makecode.com/t/physics2d-extension/42516/13 "2026-03-12T22:35:50Z")

</div>

can you explain what you mean by the new thing? not sure what you’re getting at here

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [March 13, 2026, 4:15am UTC](https://forum.makecode.com/t/physics2d-extension/42516/14 "2026-03-13T04:15:10Z")

</div>

the command “new” i never use that along with “class”

---

<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:** [March 13, 2026, 4:50pm UTC](https://forum.makecode.com/t/physics2d-extension/42516/15 "2026-03-13T16:50:12Z")

</div>

i’m not going to go into an in depth explanation here of classes and the `new` keyword, but the only way to create an instance of a class in makecode is to use `new`.

you can think of `null` as something of a placeholder value, like saying “i’ll get to assigning this variable later”, but if you ever want to actually use the variable then you’ll need to create an instance of the class with `new`.

even if you call a function that returns an instance of the class, like `sprites.create` that function is using `new` somewhere.

---

<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:** [March 16, 2026, 4:19pm UTC](https://forum.makecode.com/t/physics2d-extension/42516/16 "2026-03-16T16:19:29Z")

</div>

Is there a way to create a custom editor for makecode? like essentially a custom tilemap editor but with three views that would add on to the original engine. (I don’t care how complex or how many files and stuff we need)

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [March 16, 2026, 5:32pm UTC](https://forum.makecode.com/t/physics2d-extension/42516/17 "2026-03-16T17:32:50Z")

</div>

thank you 😁

---

<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:** [March 23, 2026, 9:49pm UTC](https://forum.makecode.com/t/physics2d-extension/42516/18 "2026-03-23T21:49:38Z")

</div>

@richard I’m mostly asking you here but where is the code for any of the editors (image, animation, tilemap, music, sound)? I’ve looked through almost all the folders and files in the GitHub repository but can’t seem to find anything. I just want to see the code that sets up the tilemap editor so I can make essentially a clone.

---

<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:** [March 23, 2026, 10:10pm UTC](https://forum.makecode.com/t/physics2d-extension/42516/19 "2026-03-23T22:10:01Z")

</div>

unfortunately, that’s not something you can do from an extension. those editors are part of the core of makecode, which lives in [https://github.com/microsoft/pxt](https://github.com/microsoft/pxt)

can you give some details as to what you’re trying to do? how would your editor be different?

---

<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:** [March 24, 2026, 7:59pm UTC](https://forum.makecode.com/t/physics2d-extension/42516/20 "2026-03-24T19:59:42Z")

</div>

I want to help @Existent_Chicken with his [3d thing](https://forum.makecode.com/t/a-3d-thing/41142) extension, and we essentially want to make a multiview tilemap editor, like Portal 2’s Hammer World Builder.  
It would look somewhat like this:

 ![Screenshot 2026-03-23 7.49.28 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/8/0/80ba3cd8fff158a58b904bf994740622bc8889d6.png)

(sorry for my terrible editing skills)  
Anyway, you’d essentially have 3 tilemap editors, and one read only isometric view of the 3d tilemap you’ve created.

[Next page](https://forum.makecode.com/t/physics2d-extension/42516.md?page=2)
