Saltar al contenido
GameGenresEnglish
Simulación

Alunizaje

Una nave cae hacia la superficie de la Luna o de otro planeta y tú la frenas con los propulsores hasta posarla con suavidad en una zona segura. Si llegas demasiado rápido, chocas con el terreno o se acaba el combustible, pierdes.

También se llama: lunar lander, aterrizaje lunar, juego de alunizaje

Esta es una ficha básica: tiene la definición y la clasificación. Las fichas completas suman historia, juegos y una demo.

Demo propia

Controles. Flechas izquierda y derecha (o A/D) para girar la nave, flecha arriba, W o espacio para encender el motor. En móvil, los botones de girar a la izquierda y el de empuje a la derecha. Espacio, Enter o clic para empezar.

Abrir en pantalla completa

Una nave cae hacia un terreno quebrado con tres plataformas de aterrizaje. Giras, enciendes el motor y gastas combustible para posarla derecha y despacio. Son tres niveles, una luna gris, un planeta rojo y una luna de hielo, cada uno con más gravedad que el anterior, y las plataformas estrechas dan más puntos.

Hecha con Kaplay, en unas 166 líneas de JavaScript.

Cómo está hecha

  1. Configuración y niveles

    Se definen los botones de girar y de empujar, que funcionan igual con teclado y con los botones táctiles. Las constantes son las reglas del género. Cuánto empuja el motor, cuánto combustible gasta y los tres límites de un aterrizaje seguro (velocidad vertical, velocidad horizontal e inclinación). Cada nivel solo cambia la gravedad, el combustible y los colores, y eso basta para que se sienta distinto.

    const k = kaplay({
      width: 640,
      height: 360,
      letterbox: true, pixelDensity,
      background: [8, 10, 20],
      buttons: {
        left: { keyboard: ["left", "a"] },
        right: { keyboard: ["right", "d"] },
        thrust: { keyboard: ["up", "w", "space"] },
        start: { keyboard: ["space", "enter"] },
      },
    });
    touchControls(k, [
      { button: "left", label: "↺" },
      { button: "right", label: "↻" },
      { button: "thrust", label: "▲", side: "right" },
    ]);
    
    const W = 640;
    const H = 360;
    const SEG = 32; // terrain segment width in px
    const THRUST = 48; // px/s² of push from the engine
    const TURN = 120; // degrees per second
    const BURN = 10; // fuel units per second of thrust
    const SAFE_VY = 20; // landing limits: vertical speed, horizontal speed and tilt
    const SAFE_VX = 12;
    const SAFE_ANGLE = 8;
    
    // Each level is a different body: stronger gravity and less fuel make it harder.
    const LEVELS = [
      { name: { es: "Luna gris", en: "Grey moon" }, gravity: 15, fuel: 120, sky: [8, 10, 20], ground: [150, 150, 160] },
      { name: { es: "Planeta rojo", en: "Red planet" }, gravity: 20, fuel: 110, sky: [36, 14, 18], ground: [190, 95, 60] },
      { name: { es: "Luna de hielo", en: "Ice moon" }, gravity: 25, fuel: 100, sky: [10, 22, 40], ground: [190, 220, 240] },
    ];
  2. El terreno y las plataformas

    El suelo es una línea quebrada con una altura por cada esquina, cada 32 píxeles. Para hacer una plataforma se igualan varias esquinas seguidas, y cuanto más estrecha es, más multiplica los puntos. Se fija la semilla del azar con el número de nivel, así el terreno sale igual cada vez que juegas ese nivel y puedes aprenderlo. La altura del suelo en cualquier punto se calcula interpolando entre las dos esquinas vecinas.

    // The ground is a broken line: one height per segment corner. Three runs of
    // corners are flattened into pads; the narrower the pad, the bigger its multiplier.
    function makeTerrain(level) {
      randSeed(level * 7 + 3); // same terrain every time you play a level
      const n = W / SEG;
      const ys = Array.from({ length: n + 1 }, () => rand(200, 330));
      const starts = [2, 8, 14].sort(() => rand() - 0.5);
      const pads = [3, 2, 1].map((len, i) => {
        const s = starts[i];
        for (let j = s; j <= s + len; j++) ys[j] = ys[s];
        return { x1: s * SEG, x2: (s + len) * SEG, y: ys[s], mult: [2, 3, 5][i] };
      });
      return { ys, pads };
    }
    function groundAt(ys, x) {
      const j = Math.max(0, Math.min(ys.length - 2, Math.floor(x / SEG)));
      return lerp(ys[j], ys[j + 1], (x - j * SEG) / SEG);
    }
  3. La nave

    La nave es un objeto con posición y rotación, más su velocidad, su combustible y su estado (volando, posada o estrellada). Su forma se guarda como cinco puntos en coordenadas propias, la punta, los dos lados del casco y las dos patas, y se dibuja en ese sistema, porque Kaplay ya aplica la posición y el giro. Esos mismos puntos, girados y llevados al mundo, sirven para detectar el contacto con el suelo.

    // A game object with pos and rotate: angle 0 is upright, positive tilts the nose clockwise.
    const ship = add([pos(180, 40), rotate(0), z(5), "ship", { vel: vec2(25, 0), fuel: L.fuel, firing: false, status: "flying" }]);
    const rot = (p, a) => {
      const r = deg2rad(a);
      return vec2(p.x * Math.cos(r) - p.y * Math.sin(r), p.x * Math.sin(r) + p.y * Math.cos(r));
    };
    const SHAPE = { nose: vec2(0, -12), bodyL: vec2(-7, 2), bodyR: vec2(7, 2), footL: vec2(-9, 8), footR: vec2(9, 8) };
    const world = (name) => ship.pos.add(rot(SHAPE[name], ship.angle));
    // Drawn in the ship's own coordinates: Kaplay applies its position and rotation.
    ship.onDraw(() => {
      if (ship.status === "crashed") return;
      if (ship.firing) drawPolygon({ pts: [vec2(-4, 3), vec2(4, 3), vec2(0, rand(12, 20))], color: rgb(255, 170, 60) });
      drawPolygon({ pts: [SHAPE.nose, SHAPE.bodyR, SHAPE.bodyL], color: rgb(220, 225, 240) });
      drawLine({ p1: SHAPE.bodyL, p2: SHAPE.footL, width: 2, color: rgb(220, 225, 240) });
      drawLine({ p1: SHAPE.bodyR, p2: SHAPE.footR, width: 2, color: rgb(220, 225, 240) });
    });
  4. Gravedad y empuje

    Es la mecánica del género. En cada paso la gravedad suma velocidad hacia abajo y, si el motor está encendido, se suma un empuje en la dirección de la propia nave: inclinarla convierte parte del empuje en movimiento lateral, y por eso frenar hacia los lados cuesta altura y combustible. La física corre en pasos fijos de 50 por segundo, así el vuelo es el mismo aunque el juego vaya a pocos fotogramas.

    // Fixed steps (50 per second) keep the flight identical at any frame rate.
    onFixedUpdate(() => {
      if (ship.status !== "flying") return;
      const d = fixedDt();
      if (isButtonDown("left")) ship.angle = Math.max(-90, ship.angle - TURN * d);
      if (isButtonDown("right")) ship.angle = Math.min(90, ship.angle + TURN * d);
      ship.firing = isButtonDown("thrust") && ship.fuel > 0;
      let acc = vec2(0, L.gravity);
      if (ship.firing) {
        // The engine pushes along the ship's own "up", so tilting steers the push.
        acc = acc.add(rot(vec2(0, -THRUST), ship.angle));
        ship.fuel = Math.max(0, ship.fuel - BURN * d);
      }
      ship.vel = ship.vel.add(acc.scale(d));
      ship.pos = ship.pos.add(ship.vel.scale(d));
      if (ship.pos.x < 10 || ship.pos.x > W - 10) {
        ship.pos.x = Math.max(10, Math.min(W - 10, ship.pos.x));
        ship.vel.x = 0;
      }
      const touching = Object.keys(SHAPE).some((p) => world(p).y >= groundAt(ys, world(p).x));
      if (touching) touchdown();
    });
  5. Aterrizar o estrellarse

    Cuando cualquier punto de la nave toca el suelo se juzga el contacto. Es un aterrizaje solo si las dos patas están dentro de una plataforma, la nave está casi derecha y las dos velocidades están por debajo de su límite. Los puntos premian el combustible que te sobra y la dificultad de la plataforma. Si algo falla, la nave explota en partículas y el nivel vuelve a empezar.

    // A landing counts only with both feet on one pad, upright and slow.
    function touchdown() {
      const fl = world("footL"), fr = world("footR");
      const pad = pads.find((p) => fl.x >= p.x1 && fr.x <= p.x2);
      const ok = pad && Math.abs(ship.angle) <= SAFE_ANGLE && ship.vel.y <= SAFE_VY && Math.abs(ship.vel.x) <= SAFE_VX;
      ship.firing = false;
      if (ok) {
        ship.status = "landed";
        ship.pos.y = pad.y - 8;
        const points = Math.round((50 + ship.fuel) * pad.mult);
        message(t({ es: `¡Alunizaje! +${points} puntos`, en: `Landed! +${points} points` }), [140, 255, 160]);
        wait(2, () => (level + 1 < LEVELS.length ? go("game", level + 1, score + points) : go("end", score + points)));
      } else {
        ship.status = "crashed";
        shake(10);
        for (let i = 0; i < 24; i++) {
          add([circle(rand(2, 4)), pos(ship.pos), color(255, rand(120, 220), 60), move(rand(0, 360), rand(40, 160)), opacity(1), lifespan(0.8, { fade: 0.5 })]);
        }
        message(t({ es: "Te estrellaste. Inténtalo otra vez", en: "You crashed. Try again" }), [255, 130, 110]);
        wait(2, () => go("game", level, score));
      }
    }
    function message(s, c) {
      add([text(s, { size: 24, font: FONT }), pos(W / 2, 120), anchor("center"), color(...c), z(10)]);
    }
  6. Los instrumentos

    El panel muestra la altitud, las dos velocidades y el combustible, como los instrumentos de un módulo lunar. Cada velocidad se pinta de verde si ya permite aterrizar y de rojo si no, así sabes de un vistazo qué te falta corregir sin memorizar los límites.

    // Speeds turn red when they are above the safe landing limit.
    const line = (y) => add([text("", { size: 14, font: FONT }), pos(12, y), z(10)]);
    const hud = { alt: line(10), vx: line(28), vy: line(46), fuel: line(64) };
    const top = add([text("", { size: 14, font: FONT, align: "right" }), pos(W - 12, 10), anchor("topright"), z(10)]);
    const safe = rgb(150, 255, 170), danger = rgb(255, 120, 110), plain = rgb(230, 235, 255);
    onUpdate(() => {
      const alt = Math.max(0, Math.round(groundAt(ys, ship.pos.x) - world("footL").y));
      hud.alt.text = `${t({ es: "Altitud", en: "Altitude" })} ${alt}`;
      hud.vx.text = `${t({ es: "Vel. horizontal", en: "Horizontal speed" })} ${Math.round(ship.vel.x)}`;
      hud.vy.text = `${t({ es: "Vel. vertical", en: "Vertical speed" })} ${Math.round(ship.vel.y)}`;
      hud.fuel.text = `${t({ es: "Combustible", en: "Fuel" })} ${Math.ceil(ship.fuel)}`;
      hud.vx.color = Math.abs(ship.vel.x) <= SAFE_VX ? safe : danger;
      hud.vy.color = ship.vel.y <= SAFE_VY ? safe : danger;
      hud.fuel.color = ship.fuel > 20 ? plain : danger;
      top.text = `${t(L.name)} · ${t({ es: "Nivel", en: "Level" })} ${level + 1}/${LEVELS.length}\n${t({ es: "Puntos", en: "Score" })} ${score}`;
    });
  7. Escenas

    Título, juego y fin (title, game y end). La escena de juego recibe el número de nivel y los puntos acumulados, así una misma escena sirve para los tres niveles y para reintentar uno tras un choque.

    function screen(title, subtitle, next) {
      setBackground(rgb(8, 10, 20));
      add([text(title, { size: 34, font: FONT, align: "center" }), pos(center().sub(0, 60)), anchor("center")]);
      add([text(subtitle, { size: 15, font: FONT, align: "center", width: 560 }), pos(center().add(0, 25)), anchor("center"), color(200, 210, 255)]);
      onButtonPress("start", next);
      onClick(next);
    }
    
    scene("title", () =>
      screen(
        t({ es: "Alunizaje", en: "Lunar lander" }),
        t({
          es: "←/→ giran la nave, ↑ enciende el motor y gasta combustible.\nPosa la nave en una plataforma amarilla: derecha, despacio y con las dos patas dentro.\nLas plataformas estrechas dan más puntos. Espacio o clic para empezar.",
          en: "←/→ rotate the ship, ↑ fires the engine and burns fuel.\nSet the ship down on a yellow pad: upright, slowly and with both legs inside.\nNarrow pads score more. Space or click to start.",
        }),
        () => go("game", 0, 0),
      ),
    );
    
    scene("end", (score) =>
      screen(
        t({ es: `¡Misión cumplida! ${score} puntos`, en: `Mission complete! ${score} points` }),
        t({ es: "Espacio o clic para volver al título.", en: "Space or click to go back to the title." }),
        () => go("title"),
      ),
    );
    
    go("title");

Qué simplificamos

  • La pantalla es fija y no hay zoom al acercarte al suelo, como sí tenía el Lunar Lander de Atari. Los bordes laterales frenan la nave en vez de dejarla salir.
  • La nave no pierde masa al gastar combustible, así que el motor empuja igual con el depósito lleno que vacío.
  • No hay atmósfera, viento ni rozamiento, y el choque es una explosión de partículas sin daños parciales.

Para modificarla

  • Añade un cuarto nivel en la lista de la región setup, con más gravedad o menos combustible, y comprueba que todavía se puede ganar.
  • Haz que la nave pese menos a medida que gasta combustible, dividiendo el empuje por una masa que baja con el depósito. ¿Se vuelve más fácil al final?
  • Añade viento, una fuerza lateral que cambia de nivel a nivel, y muéstralo en el panel.
Código completo
// Lunar lander demo
// Engine: Kaplay 3001 (https://kaplayjs.com). MIT licence.
import kaplay from "../../vendor/kaplay.mjs";
import { t, FONT, touchControls, pixelDensity } from "../common.js";

// #region setup
const k = kaplay({
  width: 640,
  height: 360,
  letterbox: true, pixelDensity,
  background: [8, 10, 20],
  buttons: {
    left: { keyboard: ["left", "a"] },
    right: { keyboard: ["right", "d"] },
    thrust: { keyboard: ["up", "w", "space"] },
    start: { keyboard: ["space", "enter"] },
  },
});
touchControls(k, [
  { button: "left", label: "↺" },
  { button: "right", label: "↻" },
  { button: "thrust", label: "▲", side: "right" },
]);

const W = 640;
const H = 360;
const SEG = 32; // terrain segment width in px
const THRUST = 48; // px/s² of push from the engine
const TURN = 120; // degrees per second
const BURN = 10; // fuel units per second of thrust
const SAFE_VY = 20; // landing limits: vertical speed, horizontal speed and tilt
const SAFE_VX = 12;
const SAFE_ANGLE = 8;

// Each level is a different body: stronger gravity and less fuel make it harder.
const LEVELS = [
  { name: { es: "Luna gris", en: "Grey moon" }, gravity: 15, fuel: 120, sky: [8, 10, 20], ground: [150, 150, 160] },
  { name: { es: "Planeta rojo", en: "Red planet" }, gravity: 20, fuel: 110, sky: [36, 14, 18], ground: [190, 95, 60] },
  { name: { es: "Luna de hielo", en: "Ice moon" }, gravity: 25, fuel: 100, sky: [10, 22, 40], ground: [190, 220, 240] },
];
// #endregion

// #region terrain
// The ground is a broken line: one height per segment corner. Three runs of
// corners are flattened into pads; the narrower the pad, the bigger its multiplier.
function makeTerrain(level) {
  randSeed(level * 7 + 3); // same terrain every time you play a level
  const n = W / SEG;
  const ys = Array.from({ length: n + 1 }, () => rand(200, 330));
  const starts = [2, 8, 14].sort(() => rand() - 0.5);
  const pads = [3, 2, 1].map((len, i) => {
    const s = starts[i];
    for (let j = s; j <= s + len; j++) ys[j] = ys[s];
    return { x1: s * SEG, x2: (s + len) * SEG, y: ys[s], mult: [2, 3, 5][i] };
  });
  return { ys, pads };
}
function groundAt(ys, x) {
  const j = Math.max(0, Math.min(ys.length - 2, Math.floor(x / SEG)));
  return lerp(ys[j], ys[j + 1], (x - j * SEG) / SEG);
}
// #endregion

scene("game", (level, score) => {
  const L = LEVELS[level];
  setBackground(rgb(...L.sky));
  const { ys, pads } = makeTerrain(level);
  pads.forEach((p) => add([pos(p.x1, p.y), "pad", { x2: p.x2, mult: p.mult }]));
  const stars = Array.from({ length: 50 }, () => vec2(rand(0, W), rand(0, 200)));

  // #region ship
  // A game object with pos and rotate: angle 0 is upright, positive tilts the nose clockwise.
  const ship = add([pos(180, 40), rotate(0), z(5), "ship", { vel: vec2(25, 0), fuel: L.fuel, firing: false, status: "flying" }]);
  const rot = (p, a) => {
    const r = deg2rad(a);
    return vec2(p.x * Math.cos(r) - p.y * Math.sin(r), p.x * Math.sin(r) + p.y * Math.cos(r));
  };
  const SHAPE = { nose: vec2(0, -12), bodyL: vec2(-7, 2), bodyR: vec2(7, 2), footL: vec2(-9, 8), footR: vec2(9, 8) };
  const world = (name) => ship.pos.add(rot(SHAPE[name], ship.angle));
  // Drawn in the ship's own coordinates: Kaplay applies its position and rotation.
  ship.onDraw(() => {
    if (ship.status === "crashed") return;
    if (ship.firing) drawPolygon({ pts: [vec2(-4, 3), vec2(4, 3), vec2(0, rand(12, 20))], color: rgb(255, 170, 60) });
    drawPolygon({ pts: [SHAPE.nose, SHAPE.bodyR, SHAPE.bodyL], color: rgb(220, 225, 240) });
    drawLine({ p1: SHAPE.bodyL, p2: SHAPE.footL, width: 2, color: rgb(220, 225, 240) });
    drawLine({ p1: SHAPE.bodyR, p2: SHAPE.footR, width: 2, color: rgb(220, 225, 240) });
  });
  // #endregion

  // #region physics
  // Fixed steps (50 per second) keep the flight identical at any frame rate.
  onFixedUpdate(() => {
    if (ship.status !== "flying") return;
    const d = fixedDt();
    if (isButtonDown("left")) ship.angle = Math.max(-90, ship.angle - TURN * d);
    if (isButtonDown("right")) ship.angle = Math.min(90, ship.angle + TURN * d);
    ship.firing = isButtonDown("thrust") && ship.fuel > 0;
    let acc = vec2(0, L.gravity);
    if (ship.firing) {
      // The engine pushes along the ship's own "up", so tilting steers the push.
      acc = acc.add(rot(vec2(0, -THRUST), ship.angle));
      ship.fuel = Math.max(0, ship.fuel - BURN * d);
    }
    ship.vel = ship.vel.add(acc.scale(d));
    ship.pos = ship.pos.add(ship.vel.scale(d));
    if (ship.pos.x < 10 || ship.pos.x > W - 10) {
      ship.pos.x = Math.max(10, Math.min(W - 10, ship.pos.x));
      ship.vel.x = 0;
    }
    const touching = Object.keys(SHAPE).some((p) => world(p).y >= groundAt(ys, world(p).x));
    if (touching) touchdown();
  });
  // #endregion

  // #region landing
  // A landing counts only with both feet on one pad, upright and slow.
  function touchdown() {
    const fl = world("footL"), fr = world("footR");
    const pad = pads.find((p) => fl.x >= p.x1 && fr.x <= p.x2);
    const ok = pad && Math.abs(ship.angle) <= SAFE_ANGLE && ship.vel.y <= SAFE_VY && Math.abs(ship.vel.x) <= SAFE_VX;
    ship.firing = false;
    if (ok) {
      ship.status = "landed";
      ship.pos.y = pad.y - 8;
      const points = Math.round((50 + ship.fuel) * pad.mult);
      message(t({ es: `¡Alunizaje! +${points} puntos`, en: `Landed! +${points} points` }), [140, 255, 160]);
      wait(2, () => (level + 1 < LEVELS.length ? go("game", level + 1, score + points) : go("end", score + points)));
    } else {
      ship.status = "crashed";
      shake(10);
      for (let i = 0; i < 24; i++) {
        add([circle(rand(2, 4)), pos(ship.pos), color(255, rand(120, 220), 60), move(rand(0, 360), rand(40, 160)), opacity(1), lifespan(0.8, { fade: 0.5 })]);
      }
      message(t({ es: "Te estrellaste. Inténtalo otra vez", en: "You crashed. Try again" }), [255, 130, 110]);
      wait(2, () => go("game", level, score));
    }
  }
  function message(s, c) {
    add([text(s, { size: 24, font: FONT }), pos(W / 2, 120), anchor("center"), color(...c), z(10)]);
  }
  // #endregion

  // #region hud
  // Speeds turn red when they are above the safe landing limit.
  const line = (y) => add([text("", { size: 14, font: FONT }), pos(12, y), z(10)]);
  const hud = { alt: line(10), vx: line(28), vy: line(46), fuel: line(64) };
  const top = add([text("", { size: 14, font: FONT, align: "right" }), pos(W - 12, 10), anchor("topright"), z(10)]);
  const safe = rgb(150, 255, 170), danger = rgb(255, 120, 110), plain = rgb(230, 235, 255);
  onUpdate(() => {
    const alt = Math.max(0, Math.round(groundAt(ys, ship.pos.x) - world("footL").y));
    hud.alt.text = `${t({ es: "Altitud", en: "Altitude" })} ${alt}`;
    hud.vx.text = `${t({ es: "Vel. horizontal", en: "Horizontal speed" })} ${Math.round(ship.vel.x)}`;
    hud.vy.text = `${t({ es: "Vel. vertical", en: "Vertical speed" })} ${Math.round(ship.vel.y)}`;
    hud.fuel.text = `${t({ es: "Combustible", en: "Fuel" })} ${Math.ceil(ship.fuel)}`;
    hud.vx.color = Math.abs(ship.vel.x) <= SAFE_VX ? safe : danger;
    hud.vy.color = ship.vel.y <= SAFE_VY ? safe : danger;
    hud.fuel.color = ship.fuel > 20 ? plain : danger;
    top.text = `${t(L.name)} · ${t({ es: "Nivel", en: "Level" })} ${level + 1}/${LEVELS.length}\n${t({ es: "Puntos", en: "Score" })} ${score}`;
  });
  // #endregion

  onDraw(() => {
    stars.forEach((s) => drawCircle({ pos: s, radius: 1, color: rgb(255, 255, 255), opacity: 0.6 }));
    for (let j = 0; j < ys.length - 1; j++) {
      const a = vec2(j * SEG, ys[j]), b = vec2((j + 1) * SEG, ys[j + 1]);
      drawPolygon({ pts: [a, b, vec2(b.x, H), vec2(a.x, H)], color: rgb(...L.ground).darken(60) });
      drawLine({ p1: a, p2: b, width: 2, color: rgb(...L.ground) });
    }
    pads.forEach((p) => {
      drawLine({ p1: vec2(p.x1, p.y), p2: vec2(p.x2, p.y), width: 4, color: rgb(255, 230, 120) });
      drawText({ text: `×${p.mult}`, pos: vec2((p.x1 + p.x2) / 2, p.y + 6), size: 13, font: FONT, anchor: "top", color: rgb(255, 230, 120) });
    });
  });
});

// #region scenes
function screen(title, subtitle, next) {
  setBackground(rgb(8, 10, 20));
  add([text(title, { size: 34, font: FONT, align: "center" }), pos(center().sub(0, 60)), anchor("center")]);
  add([text(subtitle, { size: 15, font: FONT, align: "center", width: 560 }), pos(center().add(0, 25)), anchor("center"), color(200, 210, 255)]);
  onButtonPress("start", next);
  onClick(next);
}

scene("title", () =>
  screen(
    t({ es: "Alunizaje", en: "Lunar lander" }),
    t({
      es: "←/→ giran la nave, ↑ enciende el motor y gasta combustible.\nPosa la nave en una plataforma amarilla: derecha, despacio y con las dos patas dentro.\nLas plataformas estrechas dan más puntos. Espacio o clic para empezar.",
      en: "←/→ rotate the ship, ↑ fires the engine and burns fuel.\nSet the ship down on a yellow pad: upright, slowly and with both legs inside.\nNarrow pads score more. Space or click to start.",
    }),
    () => go("game", 0, 0),
  ),
);

scene("end", (score) =>
  screen(
    t({ es: `¡Misión cumplida! ${score} puntos`, en: `Mission complete! ${score} points` }),
    t({ es: "Espacio o clic para volver al título.", en: "Space or click to go back to the title." }),
    () => go("title"),
  ),
);

go("title");
// #endregion

Historia

  1. 1969
    Origen

    El primero fue un juego de texto que Jim Storer escribió en el instituto en otoño de 1969 para un miniordenador PDP-8, el mismo año del alunizaje del Apolo 11. Cada turno decidías cuánto empuje dar y leías tu altura y tu velocidad.

    Lunar Lander (video game genre) (Wikipedia)
  2. 1973

    El libro 101 BASIC Computer Games, de David H. Ahl, publica el código de tres versiones del juego. Es un éxito de ventas, y muchas de esas versiones duran más que las originales.

    Lunar Lander (video game genre) (Wikipedia)
  3. 1973

    Moonlander, de Jack Burness para las terminales gráficas DEC GT40, es la primera versión en tiempo real y con gráficos.

    Lunar Lander (video game genre) (Wikipedia)
  4. 1979
    Lunar Lander

    Atari lo lleva a las salas recreativas con gráficos vectoriales. Si te quedas sin combustible puedes comprar más metiendo monedas.

    Lunar Lander (video game genre) (Wikipedia)
  5. 1981
    Jupiter Lander

    Commodore publica Jupiter Lander para el VIC-20, una de tantas versiones domésticas. Ese año una revista se quejaba de que cualquiera que supiera copiar un casete vendía su propio juego de alunizaje.

    Lunar Lander (video game genre) (Wikipedia)

Juegos de referencia

1979

Lunar Lander

Atari. Arcade

Máquina recreativa con gráficos vectoriales. Giras el módulo y regulas el empuje para posarlo sobre una zona plana, y si se acaba el combustible puedes comprar más con monedas.

1981

Jupiter Lander

Commodore VIC-20

Versión del alunizaje que Commodore publicó para su ordenador doméstico VIC-20, con la nave bajando hacia la superficie de Júpiter.