spade-serial
and spade-upload
! They can upload games to a #C02UN35M7LG| or whatever device running Spade. I spent a lot of time writing the tests and documentation.. I wanted to get it right since this is my first time, so I know what to do in the future. spade-serial
is the crate that does the actual work while spade-upload
is the application that makes use of the crate. It's useful to me because I use Safari on my MacBook and Firefox on my other laptop, neither of which implement the Web USB API, so this provides a way for me to put games on my Sprig without installing another browser that I don't want to use. I made spade-serial
into a crate because I wanted to keep the logic separate so that people could apply it in multiple places, like maybe a GUI app.
The game uploaded in the video is this game. I did not create it.
GitHub Repository | spade-serial on crates.io | spade-upload on crates.ioText
class as a textObject
closure. I did this because private properties in functions were causing syntax errors in my physical Sprig, and I didn't want to just prefix it with something like _
because it doesn't actually enforce private-ness. With a closure, I can have variables out of scope for consuming code. I did the same with GameObject
-> gameObject
, Command
code.
Plot twist: when I opened the Sprig editor to take a screenshot for Scrapbook, my changes were magically there! Maybe I had multiple tabs or something and one was out of date. I should commit this tomorrow because it's getting late./connect host:port
, with host
being a hostname or IP address to the machine running the app and port
being the port displayed in the app. Encrypted WebSockets aren't implemented yet, so you might need to turn off 'Require Encrypted Websockets' in the Minecraft profile settings. The app should be connected to the game and the 'Connect' button should turn into the 'Run' button.
github.com/MacaylaMarvelous81/minecraft-codeawait
, so I had to switch to using sendSync
instead of invoke
with Electron ipc. Currently, the only event from the game I have is an event when the player dies. I could add more events, but they would be more useful if the event data could be used, so I want to figure that out first. I'm thinking that I could use value blocks to represent the last data received from an event, like in the picture.agent.teleport(null, 100, null)
which goes through JS-Interpreter to Electron to the WebSocket server to Minecraft. I only have a few blocks so far, and I hope to add events, but I think I've got the basics!