MicoJS - online multiplatform JS IDE

I hope @FManga will forgive my impatience, but I can’t help but share a great new software development tool that I’m really excited about.

I will write short features that I noticed during the tests, but the author may add more details in the description later.

Beta version of multiplatform online JS IDE made by @FManga
for creating games and applications
(Pokitto, Gamebuino, ESPboy support implemented).

  • Online JS editor, compiler and emulator
  • Ability to load compiled applications on ESPboy from browser

Quick API manual

1 Like

A little update on the JS IDE from @FManga

  • Added support for sprite rotation/scaling on all platforms
  • Added rect function for drawing solid rectangles
  • Finished automatic image conversion for all platforms.
  • Image viewer allows comparing original/converted images (mouse over the image).
  • All built-in fonts are now available on all platforms through setFont(R.fontName)
  • Added a wiki documenting pretty much everything: Home · micojs/micojs.github.io Wiki · GitHub
  • Started working on tilemap support in the IDE.
  • Started looking into supporting GBA or NDS.

2 Likes

News from @FManga

  • finish tilemap support
  • fix bug: files not getting saved done
  • support for sound effects
  • fix bug: debug function freezes on Meta
  • clear/hide debug log
  • fix bug: debug prints one argument per line. done
  • support flashing on Meta. done, but needs more testing

before I get back to tilemap support, I’ll try making a little game as well to be sure there are no other serious bugs

1 Like

News from @FManga

  • Added “Export” button for exporting the entire project as a zip (no way to import yet)
  • Fixed bug in getWidth/getHeight
  • Fixed default font printing gibberish on Pokitto
  • New palette
    image

MicoJS Online IDE

Quick Intro:

  • Generates native code, no VM/interpretor
  • Based on Monaco (VSCode’s editor)
  • Your sourcecode is stored in your browser but can be exported as a zip file
  • Aims for full JS language compatibility, not API/library compatibility
  • Full-res 8-bit graphics engine with sprite zoom/rotation/recoloring support
  • Built-in simulator runs well even on very slow devices
  • Games are platform-independent by default
  • Wiki documenting both the API and language
  • Autocomplete with documentation
  • Built-in asset conversion. Drag-and-drop an image into the file list and it’s ready
  • Uses a general-purpose palette, based on this paper.
  • Built-in ESPboy flashing support

Planned Features

  • Import zipped project
  • Project sharing between multiple users/browsers
  • More UI polish
  • Audio support
  • Tilemap support
  • Hotspot profiling (partially implemented already)
  • Built-in image editor
  • More JS language support (see wiki for up-to-date list of what’s missing)
  • Export game as a single HTML file for sharing
  • Debug builds that tell you where/why a crash happened on hardware without a debugger
1 Like

Latest changes:

  • Zipped project import (drag-and-drop a zip into the file tree)
  • Automatically clear debug log when starting the simulator
  • Ctrl+Enter (or Cmd+Enter on Mac) shortcut to start the simulator
  • Ctrl+S no longer tries to save the IDE as an HTML page
  • 32Blit support
2 Likes
  • Added support for PicoSystem
  • Added support for game metadata (still need to show game name / title in ESPboy splash screen)
  • Sourcecode for the MicoJS buildbot, transpiler, and IDE is now online: GitHub - micojs/MicoBot
  • Added “Performance Considerations” section to wiki
1 Like
  • Fixed minor IDE bug that happens after a file is deleted
  • Update PokittoLib and fix Pokitto builds
  • Add support for string.length
  • Fix transpiler errors showing up as “[Object object]”
  • Added pragmas documentation to wiki. These allow you to do things like including/excluding blocks of code depending on the platform, much like C’s #ifdef ... #endif blocks.
2 Likes
  • Fixed a bug in the text rendering code
  • Optimization: allow ints to be used as object/array keys without converting to string first
  • Optimization: look up array length only once in for-of loops (non-standard behavior)
  • Optimization: recycle text and rect drawing commands between frames (experimental)
  • Added FAQ section to the wiki
  • Implemented ternary operator
2 Likes
  • @Jicehel made a really nice tutorial in French.
  • Implemented bitwise not (~) operator
  • Implemented constant expression folding (a = 1 + 2 becomes a = 3)
  • Automatic this property caching (this.x = this.x + 1 only looks up x once)
  • Implemented support for numeric object literal keys ({3:"hi"})
  • Fix bug in IDE when switching between projects
  • Fix bug where drawing a null sprite would draw the previous valid sprite
  • Only run garbage collection when necessary
  • Implemented profiler for Meta and Pokitto hardware (will document in wiki)
  • Optimize string method access
  • Optimize run-time string RAM use
  • Implemented array.indexOf(needle) and string.charCodeAt(index)
  • Fix compiler error when using the Adventurer font on ESPboy
  • Use @r043v’s async technique for LCD writing on ESPboy
  • Fix bug where palette had only 255 colors.
2 Likes

MicoJS improvements from @FManga :

A small update today:

  • Fixed a bug where lambdas were not capturing external local variables properly and would crash
  • TileMap converter no longer exports hidden layers
  • All tiles’ properties are now merged together in the base layer (including hidden layers), making them easier and faster to access
  • Added scanTileMap({properties:values}, (x, y) => debug('Found match', x, y)) for all platforms (useful for instantiating player/enemies/items/etc)
1 Like

Today MicoJS improvement from @FManga :

Some more updates, for all platforms:

  • Implemented support for for(let key in object)
  • Implemented value = clamp(value, min, max)
  • getWidth(R.tilemap) and getHeight(R.tilemap) return a tilemap’s total dimensions in pixels
2 Likes

MicoJS update from @FManga

  • Fixed a copy-paste bug in the abs function (was returning a negative value for floats)
  • Implemented sign(value:number):number; which returns -1, 0 or 1
  • Implemented hash(str:string):number which is useful for string tile properties: const isWall = getTileProperty(x, y, ‘type’) == hash(‘wall’);
3 Likes

MicoJS weekend update list from the @FManga:

  • Fixed large tilesets (>255px in one dimension) not rendering properly in the browser simulator
  • Fixed the === operator returning false for (int) 1 === (float) 1 (any mixed combination of uint/int/float)
1 Like

@FManga:
“Initial/rudimentary Blockly support is now available in MicoJS for testing.”

Fantastic Blockly features! I added a bat control to the example and it was very easy) I should try to do something interesting this year using MicoJS Blockly

  • You can now import a project zip into a new project by dropping it into the project list
  • You can now merge a project into the current one by dropping it anywhere in the file list
  • Fixed a bug where not all properties were being counted when calculating a class’s size
  • Fixed duplicated row on text
  • Fix folders being ignored when importing a project zip
  • Added support for HTML export
  • Exported HTML now consumes key events to avoid scrolling around
  • Exported HTML now uses the system drop-down to determine resolution, instead of having a hardcoded value
  • Added confirmation when deleting a project
  • You can now import a project zip into a new project by dropping it into the project list
  • You can now merge a project zip into the current one by dropping it anywhere in the file list
  • Fixed a bug where not all properties were being counted when calculating a class’s size
  • Fixed duplicated row when rendering text on hardware
1 Like

news from @FManga

Fixed compiler bug: var x; for(x of []); Tentative fix for titlescreen bug on Meta Added some more functions to BlocksEditor:

  • Angle difference (Math tab)
  • Screen Width / Screen Height
  • Image Width / Image Height

New section “MicoJS” has been added to ESPboy AppStore.

The following games are added now:

1 Like