Inicio
Floaty es un port en JavaScript de Pico-8 que busca paridad de funciones (con desviaciones en la implementación donde sea apropiado). Creé Floaty para poder enseñar JavaScript a personas sin experiencia en programación, sin todo el código repetitivo que se necesita para ir de un documento vacío a un juego funcional.
Espero que llegue al punto en que pueda seguir cualquier tutorial de Pico-8 usando las funciones y tipos de datos correspondientes en JavaScript. Espero que llegue al punto en que cualquiera pueda crear un juego pegando una etiqueta script en su documento HTML y empezando a programar.
Playgrounds Destacados
Plugins Destacados
This plugin adds a slight shadow underneath all text you draw, using the same text method.
Primeros pasos
Aquí tienes un pequeño ejemplo del código que necesitarás para crear un juego:
import Engine from 'https://floaty.dev/engine-v2.js';
const engine = new Engine();
engine.scope(({ start }) => {
const sprites = {
// this is where your sprites go
};
const 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
}
start({
target: document.querySelector('.game'),
sprites,
sounds,
init,
update,
draw,
});
});