Gamebuino Meta games in JavaScript

Hello!
This is something I’ve been working on and has support for the Meta.
Many thanks to @Jicehel for beta testing for me. It is still a beta, but stable enough for people to start having a look and making things with it.

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.

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
4 Likes

Congratulation @FManga ,
this is very impressive work. :heartbeat:

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
1 Like

Well done FManga. I will try it soon :slight_smile:

1 Like

Thanks!
I’ve been mostly working on bug fixes lately:

  • Fixed a bug in browser version of vectorLength function
  • Fixed a bug where use of null would generate invalid code
  • Fixed a bug when comparing someString != otherString
  • Fixed a bug where strings weren’t triggering the garbage collector
  • Added PI / HALF_PI / TWO_PI
  • Added getTime function
1 Like

Hi @FManga ,

Your tools is it compatible with Typescript ? Or it’s to the futur release ?

Unfortunately, no. I’d like to support it in the future, but there’s work to do before that can happen (mainly replacing the current Esprima-based parser with Babel).

You think that circle could be added like rect ?

I hope that Typescript compatibility will be assured one day :wink:

  • Sourcecode for the MicoJS buildbot, transpiler, and IDE is now online: GitHub - micojs/MicoBot
  • Added “Performance Considerations” section to wiki

While it’d be simple to add that function, it’d be better to have a particle system instead, and that could have rects/circles without bogging down the rendering engine too much. I’ll have to do some testing first.


I’d like that too, type information could be useful for the compiler to make better/faster code, so it makes sense.

1 Like
  • Fixed minor IDE bug that happens after a file is deleted (thanks to @chris-scientist for reporting it)
  • Add support for stringVar.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:
{"ifeq platform blit";
debug("32Blit");
}
{"ifeq platform pokitto";
debug("Pokitto");
}
{"ifeq platform meta";
debug("Meta");
}
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 (a = b ? c : d)
1 Like

Maybe you could share some basic games ior add on projects menu the abilitu to take some basic example code of games (shoot them up, plateform, pong, asw…) (Not all, just some to show user as with bat, how to use fine langage with concrete examples merging all the advices of the wiki and with the structure of a more complexe game). You could even add them as creation here to be able to test them in emu and see they works fine in emu and real hardware.

1 Like

I guess I’ll make a Space Invaders clone, you already made Pong. :slight_smile:

1 Like

Good idea. The more important is to write it well to let other see how to do if they need as is done when i was asking you as i think you’ll not be able to answer to all and we don’t have yet ability to answer for you if they have questions and that we have answers :wink:

1 Like

Hi Felipe, for the META, a cool change could be to have to fill a properties with repository name. This name would be use to make a repository where to save 3 files: ICON.bmp (a 32 x 32 picture), TITLESCREEN.bmp (a 160 x 128 picture) and repository.bin (the compiled bin with same name as the repository choosen). Then the user will juste have to clic on build, it’s make a zip with the repository to write on the SD card of the META. It’s coul be a little quickest that to have to rename builded prog each time.

1 Like
  • @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)
  • Implemented array.indexOf(needle) and string.charCodeAt(index)
  • Optimize string method access
  • Optimize run-time string RAM use
  • 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.
1 Like

And for Meta, speed increased alot when compiled and running in emulator or on physical META. Great job :slight_smile: Now, MicoJS is a real usable solution to program on META. And it’s will more again as we know your roadmap for the futur impeovements (you can read my english and now you know why i make tuto in french :D) ATM I’m busy but i will make another Workshop later as i have not yet explain alot sprites, multi files use for objects, loops, fonts (even i think that printing fonctionality could be improved to be able to have sizable fonts to be able to more do that we want when using a font). The langage is young and will continue to evolve but it’s already a great solution to make programs and port them from a console to another fast.

1 Like
  • I’ve started adding suggestions/bugs as issues so that they don’t get forgotten. Feel free to add more there as well.
  • Did Meta-specific optimizations, framerate is pretty good now.
  • Initial tilemap support
  • Allow flashing the 32Blit and Meta directly from the IDE after clicking “Build”
  • Fixed bug in setFPS not working on hardware
  • Implemented support for scrolling tilemaps (simulator/32Blit/Meta/PicoSystem/Pokitto)
  • Implemented getTileProperty(x, y, propertyName). See API.
  • Fixed issue with fonts not being set correctly in the simulator
1 Like