floaty is a JavaScript port of Pico-8 which aims for feature parity (with deviations in implementation where appropriate). I created floaty so that I could teach JavaScript to non-coders without all the boilerplate it takes to go from an empty document to a working game.
I hope that it gets to the point where I can follow any Pico-8 tutorial by using the corresponding JavaScript functions and data types. I hope that it gets to the point where anyone can build a game by pasting a script tag in their HTML document and starting to code.
Here's a tiny example of some of the code you'll need to make a game:
import { Engine } from 'https://floaty.dev/engine-v1.js';
var engine = new Engine();
engine.expose();
var sprites = {
// this is where your sprites go
};
var sounds = {
// this is where your sounds go
};
function init() {
// things to do when the game starts
}
function update() {
// things to do each game tick:
// updating the game state
// moving the player
// handling input
}
function draw() {
// things to do each time the screen updates:
// - clearing the canvas
// - drawing on the canvas
}
engine.start({
sprites,
sounds,
init,
update,
draw,
});
// code: https://codepen.io/assertchris/pen/yLZMVGO
spr
method for larger sprites