Discord
Login
Community
DARK THEME

microStudio now supports 4 programming languages: microScript, Python, JavaScript and Lua!

This is quite the big update: you can now choose from 4 programming languages for your microStudio project: microScript, Python, JavaScript or Lua! All this still from your web browser. With any of these 4 languages, you have access to all the microStudio goodness: live edit your code, live help and screen positioning hints, use the new graphics libs for 2D or 3D, use the optional libs like Matter.js and Cannon.js, export your project to HTML5, Windows, Mac, Linux, Android in one click.

You can thus create your next 3D game in Python with Babylon.js. Or make another one in Lua, relying on Matter.js and Pixi.js. How awesome is that?

Why Python?

In many countries, high school students have to learn Python. Letting them stick to Python with microStudio will help them practise the language they will be tested on, rather than having to switch from one language to the other.

Why JavaScript?

Some users may be concerned with performance for their game. I have good news for them regarding microScript (read below), but if you are making a procedurally generated world in real time with thousands of collision checks or whatever, you may want to rely on the core language of your engine and avoid adding another language layer on top of it. In microStudio, the core language is JavaScript and JavaScript in the browser is insanely fast.

Why Lua?

I have heard people asking why they would have to learn a different / simplified Lua when they already know Lua. Offering Lua will maybe make microStudio more attractive to these users.

What about microScript?

microScript remains the best language to work in microStudio, here is why:

  • microScript is simpler, yet complete and very forgiving to beginners. microScript won't call you names because you forgot to define a variable.
  • No runtime errors: microScript cannot break at runtime. This is a huge advantage: it means you can really work on your program while it is running, making changes live without the risk of breaking the flow constantly and having to restart the game every time.
  • With today's release comes hot updates of classes, meaning that you can work on a class definition and instantly see the result applied to all the object instances derived from your class in the running game. This is making coding in microStudio even more interactive.
  • I made a lot of research and thinking on microScript v2. This new version will not only bring a few more features, some more flexibility and a clarified specification. I have started working on a new type of interpreter, based on an intermediate representation and a stack machine. This interpreter is showing great performance, to the point I will have to evaluate if a transpiler is still needed. It is also more flexible in many ways, allowing to get rid of the "timeout" limitation, to interrupt and resume execution at any time (think "breakpoints"). It is also the best working base you can imagine for a future implementation of microScript in C / C++, for native exports.

I would like to add that today's update (as well as recent updates with 2D/3D engines and physics engines) wouldn't be possible without the hard work of fantastic people making all the following open-source libs:

And of course also:

That leaves me speechless (what doesn't happen very often...) I can only start to imagine how much time and effort that must have taken you. It will open up microStudio to such a huge potential user base.

Well Done

Incredible again - I can't help but continually be amazed as microStudio continues to grow (especially at the rate it's growing)! If you aren't using microStudio yet this should be more then enough to convince you ;)

Quick suggestion - to save lazy programmers like me the effort of going to settings and switching languages, API, etc. maybe there could be a options menu that pops up when you create a project so you can pick these options beforehand (of course, options would still be changeable in settings).

This amazing. As I started with python and now can use it in my go to engine, I have no words. And the extended graphics libs are very helpful. But I have a quick question:

Can M2D or pixi.js use microStudio's tilemap system?

Thanks!

@this_name_is_taken yes I should probably add it under another "Show advanced settings" link, in the project creation box. I want to keep the initial experience of microStudio as simple as possible.

@MrBoi there is no documented way to display maps in Pixi.js and M2D yet, I have to work on that. In the meantime, this unofficial way should work:

micro 2D

  map = new M2D.Sprite(maps["my_map"].getCanvas(),200,200)
  scene.add(map)

Pixi.js

  map = PIXI.Sprite.from(maps["my_map"].getCanvas())
  stage.add(map)

This is really cool! I didn't expect the engine to come this far since I left it for a while. Good job on the engine, Gilles!

@gilles That's a fair point. However, I also feel like those still having their initial experience of microStudio (especially those that rarely visit the community) may miss that you can change the programming language to one that they prefer or have prior experience in. A 'show advanced settings' option near the project creation box sounds great though :)

Hey Gilles, is there a way to force a programming language for tutorials instead of defaulting to Microscript? I'd like to make/modify tutorials for Python but at the moment my tutorial projects (once launched by the user) default to microscript. Is there any way to change this?

@MRBDR here is how to force user's project to Python when you initialize a project in a tutorial:

# Tutorial

:project My Project { "language": "python" }

I hope this helps! I should document this somewhere probably...

When I am trying to use Javascript to begin my project, I keep receiving the error, Unexpected Token "<" in line 34, though... I only have 4 lines of code, what do I do?

@aj0822 : In the code editor you will always see this message when you have a javascript syntax error. It doesn't matter which line of code the error is on and what kind of error it is. Unfortunately, this makes it difficult to find the error, especially when it's a typo. See to my code what javascript looks like in my project, You can also try to add some error line and you will also see the same message.

If you still can't find the error, please provide a link to your project.

https://microstudio.io/i/Loginus/quadtree22/

@aj0822, it's always good to show your code, or else people can't help you that much. Kinda sounds like you may have forgotten the parenthesis on an if statement, but... without seeing the code my guess is as good as a shot in the dark.

When that line 34 error happens, one thing you can do is comment out the code you just wrote, so the error goes away, and then uncomment it in parts until the error appears again. Then you'll know where it's coming from.

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community