How to structure and organize a large engine-level extension in MakeCode Arcade?

I’m working on building a MakeCode Arcade extension with multiple core systems (e.g., sprites, camera, zoom, physics), and I want to structure it cleanly for hundreds of lines of code.

Some challenges I’m facing:

  1. Keeping multiple classes and renderable systems organized in a single file.
  2. Maintaining consistent update loops for engine logic (e.g., camera, zoom, physics).
  3. Designing smooth transitions and multi-line functions that interact correctly without breaking other systems.

I’d like advice on patterns or strategies for structuring large engine-level TypeScript files in Arcade, including how to:

  • Organize classes and helper functions
  • Manage renderables and smooth updates
  • Keep code maintainable as the system grows

I’m intentionally avoiding high-level game logic; my focus is on the engine implementation itself. Minimal examples or pseudo-code are welcome.

3 Likes

well I made this level extension does this help https://github.com/neverstopthecoder/level-extension

and I can help you make this extension because I’ve made a lot of extensions so just let me know if you need help

1 Like

I like that good hard work but I know I like that hard work good job but I am still asking for something else. To be honest, if you can you help me with making a good extension that is litterally no game logic and I want it to be a extension for advanced tilemap Collisions like slope engines if it is a tilemap obstacle the wall is not simply a AABB collision, but a slope, you do not need to help me I might can fix it by my own but if you just want to help me you do not mind doing it. Here is a source I did found to give me some experience and I think it could help you understand what I mean. https://github.com/microsoft/pxt-common-packages/blob/master/libs/game/physics.ts I mean thank you did your best just I reccomend clicking that blue link above to help me, thank you for your effort though, good job.

so I tried to understand the link and what you said and I will admit I’m not the like unreal engine best at making an extension but I can give this that any code you can do in block and cram into a function it should work for example this

is the same as

image

image

1 Like

and I’m not sure if you know how to start a extension but go into JavaScript go the the explorer and click the plus button it will create a example extension like this

I changed a little bit to make it a little more easy hope all of this helps

1 Like

and heres what it would look like in blocks

1 Like

So sorry I know how much hard work thank you so much but I do not mean how to create an extension I mean I am trying to create a slope engine can you help me please. I need help is to have a base sample of the code I need I am so sorry if it is hard for you to understand but here is the link if you want to inspect the link I viewed here is the link for it so you can be able to view the code of the collisions. https://github.com/microsoft/pxt-common-packages/compare/master...DeveloperTryingToCodeLikeOtherOfThem:pxt-common-packages:patch-4 Click the blue link to view the code and I do not need that much help but I just need help for changing that structure as a slope engine instead of a AABB, otherwise thank you for the help it does help but I just mean I need help for creating a slope, thank you.

I also mean I do not want to call infol.changeScoreBy I am trying to create a new totally different extension using low level functions avoiding the APIs system, I did watch makecode videos but they do help a bit but I still need to think what I need to make because it is an engine not simply just using annotations but real structure that is why I asked I need a lot of lines just a simple idea of how to make an extension like that is very thankful I could get an idea of making it already, I do not need many help I just want some hints to make it accurate not an AABB like a demo out of it.

I am very proud that you did help me thank you so much but I do not simple extensions and I am just trying to make at least one extension down that is advanced like not just using high level, I am trying to use like __draw and __drawCore for the extension and I am still thinking what to do to make the slope engine better, otherwise I am very proud of you helped me thank you so much for the effort.

Also I forgot to tell you is if you do not need see the whole code of the tilemaps collisions, you need to expand it up or down, it should say something like @@ -640,151 +243,23 @@ here and in the left side you can see the arrows but first remember to scroll down or maybe not all the way down but I will say it is in the middle then you will see it about, that is how you expand to see the other rest code of the tilemap collisions code.

Also I already know all syntaxes about functions in makecode so I already understand how to define them already. I am just talking about making it like a advanced extension.

i know your not trying to make a extension im just saying if you could do it in blocks than

and I will try to help best I can but I’m probably not the guy your looking for and you don’t need to code with advance stuff to make it look advance

also may I recommend looking at Slopes Physics engine!

or New Slope Engine! or :duck: Slopes or maybe Slopes gravity

1 Like

And also I already know not just function syntaxes but all the syntaxes already like namespaces and classes, I really made this topic so I can get some help for my extension so I can finish it and make an extension or demo of a slope engine out of it.

or maybe even Sprite Walls Engine – Extension - #21 by Sonicblaston

1 Like

Thank you so much it does help but I did fix the issues already anyway, but it does help as well anyway as well so thank you it does help but I did find the way I already aimed for doing it, otherwise thank you for your effort I appreciate it.

Also I already know that their are people making slopes I was meaning just real slopes not just using velocity x and velocity y to make it go up and down a hill or something, I mean more advanced than those because sometimes if your slope does like that way it can lag sometimes I like the effort and yes they cannot crash that often but I am going to find a way to make more slopes than just those, but thank you for your time I appreciate it so much.