How to make a MakeCode project an emulator which works like an app(exe)
I don’t think you can @Pixiloom, you can only save the game on the arcade website, to your Microsoft account, or as a png which can be dragged and dropped into the editor to instantly load all of your code.
Opening arcade files as apps would be fun though… maybe the MakeCode Team could review this?
Very interesting topic, @Pixiloom! I have been researching the same thing myself lately, without making any real progress.
But I have made some observations that I would like to share here as an attempt to answer your question(and maybe others could help us further?), where I understand “app” as a broader definition of a “one-click solution to launch a MakeCode Arcade(MCA) game/program on the desired system/platform”, even though you specifically mention exe(Windows executable) in your question:
- Windows executable: Though I still have not found out how to compile a simple native Win32-type executable, the open GitHub pxt source code is full of references to WinRT, UWP etc. I am not sure whether the functionality is restricted on makecode.com and if it might be possible with a local instance of the pxt server running, or if I just have not found the right “magic” URL flags yet.
Linux executable(at least for ARM/RPi, haven’t tried x86/x64 yet): However, a solution for compiling and running a standalone executable for Linux, is already there:
UWP app: There’s also an interesting GitHub project by @eanders for running MCA games as an UWP app: https://github.com/eanders-ms/arcade-uwp-demo.
I managed to compile and run this from Visual Studio, but I get an access violation referencing the provided pxt.dll when I try to swap the included “castle-crawler” game with any other game(compiled with as experimental VM pxt64 file). I am not sure yet if there are other variations possible of the pxt64 files to compile to than the VM, if there are version differences or what is preventing this from working. It is also a very impractical solution, since every appx deployment has a size of 10-100MB for each MCA game file of 150-500kb, and the produced exe file in this project does not execute standalone with Windows standard shared libraries.
There is a VM solution included(but deprecated?) in MCA, which @mmoskal describes as:
- “…a native SDL-based interpreter for MakeCode VM bytecode. That worked on Windows, macOS and Linux (all x86, but I see no reason it wouldn’t work on ARM)…”,
- “…not really used by anyone (it’s 5x slower than normal native compilation), when it will be used we’ll fix it.”(The speed penalty should not be a problem on modern desktop hardware) when trying to compile at makecode.com, and
- " You may also see
"vm"in future."(Coming soon? VM already an experimental feature/hardware…)
But the wheres, whats and hows regarding the VM simulator(a standalone app somewhere?), to actually run the pxt64 bytecode on Windows, MacOS and Linux is still unclear to me, and - as mentioned above - I am not sure how it is connected to @eanders’s project and whether they also could be compiled as standalone native Windows executables?
As a final suggestion for achieving a one-click solution, could be a collection of Web-links to the shared full screen playable web links of online MCA games, which would open be played in Microsoft’s web simulator inside your preferred or a minimal (kiosk) browser from the desktop, a folder, RetroPie/-Cake etc.
Just for completeness, I will mention the standard and well-known uf2 boot image solution for loading and playing MCA games on various supported (handlheld microcontroller) devices.
Any new information about and solutions to this(especially the standalone Windows executables and a VM solution not requiring 100MB of UWP for each game) is very helpful and greatly appreciated!
You can just turn the website (share the game) into an app with this website.
Hmm yes but still it would be unsupported after you make it an app since it won’t be the official app, meaning that you’ll be stuck with the same glitches that the current version of MakeCode Arcade has.
Also if you were going to say just redownload it every time there’s a patch, think about the pain your computer has to go through to download something like Office apps, and multiply that by 10, that’s the torture you’re putting the computer through. (Jk do whatever you want with your computer lol)
For anyone skilled enough to contribute and inclined to share, or just curious or interested enough to learn more about the pxt build system and figure out how to make MakeCode Arcade games run as (experimental and as of yet unsupported)standalone apps/native executables on Windows, Mac and Linux etc., there is an ongoing GitHub issue about this in @eanders’ explorative UWP repo here:
As I understand it, this should definitely be possible, with such native and VM build targets already envisioned at some time and included in MakeCode/pxt, but with “a couple regressions” today that should be possible to fix.
For me, this looks a little like the perfect community project, befitting MakeCode’s open source, its mission statement* and its friendly and knowledge thirsty users, where everyone can be creative and have fun together while learning from, and finding and developing new use cases for technology. -Maybe MakeCode Arcade even carries a little bit of the spirit of will it run Doom?
Looking forward to seeing the first MakeCode Arcade game playable on a bread toaster!!!
Since there was no online multiplayer support, the MakeCode Arcade kiosk solution under development is probably a subject more befitting to this thread about playing MCA games in/as app.
Maybe, as @personalnote is on to, that this could be bundled/framed/compiled/packaged somehow to run as a cross platform and offline app/PWA, and a possible solution alternative to what @Pixiloom is searching for?:
By the way: Anyone who lately has gained any experience or new knowledge about the mysterious experimental/beta VM option in the hardware selection menu in the editor?