For an overview on what Wyldcard is, check out the introductory blog post. After spending seven hours in the top position on Hacker News, I decided to crowdfund a Wyldcard DevKit on Crowd Supply
If you have a Wyldcard DevKit, you can program your own functionality and implement game mechanics using JavaScript. (You could also dive into a deeper level and program in any language you want, more on that later)
A simple Wyldcard demo that displays a random image on a card whenever a button is pressed could look like this:
let fs = require('fs/promises')
let path = require('path')
let { Plinth, imageUtilities } = require('@wyldcard/drivers')
async function main() {
let plinth = new Plinth('devkit')
let displayRandomImage = function(well) {
return async () => {
let image = await imageUtilities.randomImage()
well.displayImage(image)
}
}
plinth.wells.forEach((well) => {
well.onAButtonPress(displayRandomImage(well))
well.onBButtonPress(displayRandomImage(well))
well.onCButtonPress(displayRandomImage(well))
})
}
main()
In order to get to running this code, we need to go over the following:
If you want to design your own Wyldcard-compatible hardware, check out:
This repo also contains
- Examples and Demo code
- napi-rust-drivers - The core Rust code which runs the Wyldcard e-paper displays and the javascript native api wrappers which form the SDK
- images - Information about images, how to format them, programs for formatting and sending them to the Wyldcard plinth and some sample images to use
For a blog-post style tutorial, see: