Nodes/Comfy-URN-Arcade-Games/URN Arcade Lunar Lander
ComfyUI Node

URN Arcade Lunar Lander

The hardest thing on your ComfyUI canvas is landing this triangle

By Clivey1234·Created about a month ago·Updated about a month ago· 2
URN Arcade Lunar Lander

      Space Invaders is reflex. URN Arcade Lunar Lander is patience. You get a white wireframe lander, a lumpy procedural moon, three landing pads worth 2×, 3× and 5×, and a fuel gauge that punishes every panicked tap of the thruster. If you're the kind of person who fiddles with a sampler while a 25-step upscale crawls, this is the one that quietly eats twenty minutes.

      What it is

      One of five arcade nodes in Clivey1234/Comfy-URN-Arcade-Games. Same deal as its siblings: standalone, no inputs to wire, no outputs, no interaction with your graph. Drop it on the canvas next to the workflow you're babysitting and click it when the queue starts.

      ComfyUI itself is still a machine that spends most of its life making you wait - the loudest recurring gripe in the ecosystem is setup and download overhead, and the second loudest is staring at a bar. A canvas widget that costs no meaningful VRAM is a better answer than alt-tabbing into a real game, which on a heavy video render is exactly what your GPU can't spare.

      How the thing is put together

      The Python class is a stub. It inherits a base that declares nothing visible, returns an empty tuple, and is not an output node, so the executor prunes it - this node cannot affect, delay or crash a render. Everything you see is frontend JS loaded via the pack's WEB_DIRECTORY.

      web/urn_arcade_lunar_lander.js registers a ComfyUI extension, and on node creation it mounts a DOM widget with a canvas inside and grows the node to at least 480×560. The widget is non-serialising, so it stays out of your saved workflow JSON. It also wires itself to ComfyUI's execution events - queue a prompt and an idle game auto-starts, with a footer dot going green while the job runs.

      Click the play area before you touch a key: keyboard handling is bound to the canvas, which takes focus on click. Arrows are swallowed with preventDefault(), so you rotate the ship instead of panning the graph.

      The physics, and why you'll crash a lot

      Controls are three keys. ← and → rotate, ↑ is the thruster (hold it), P pauses, R restarts. That's it - no fire, no reverse.

      • Fuel: 1,000 units, burned at 85/second while thrusting. Under 180 the gauge goes red and the fuel_warning.wav loop starts nagging you twice a second. Free-falling is free; learning that is the game.
      • Landing: you need horizontal speed under 0.045, vertical speed under 0.075, and the angle inside about 12.6° of upright. Anything else is a crater.
      • Scoring: (200 + fuel × 0.08) × pad multiplier. So the 5× pad isn't just bragging rights, and a full-tank textbook landing is worth far more than a sputtering one.
      • Terrain: regenerated every level from a seed derived from the level number, 72 points of jitter, with the three pads stamped flat into it. Gravity creeps up a little each level, and you get three lives.

      The HUD shows ALT, HSPD, VSPD and ANGLE in monospace - it's genuinely the most useful readout in the pack, because altitude alone tells you nothing about whether you're about to die.

      Install

      Manager → search URN Arcade. Or:

      cd ComfyUI/custom_nodes
      git clone https://github.com/Clivey1234/Comfy-URN-Arcade-Games.git
      

      Restart ComfyUI afterwards; new frontend extensions aren't picked up mid-session. There is genuinely nothing else to do - no requirements.txt, no install.py, no checkpoints, no pip conflicts to unstitch. That matters more than it sounds: custom nodes share your Python environment with no isolation, and every pack that does install something is a roll of the dice. This one installs nothing.

      Sound and the Sounds folder

      Sounds/LunarLander/ contains thrust.wav (looped while you hold the button), touchdown.wav, crash.wav, fuel_warning.wav and level_complete.wav, served through a route the pack registers on the ComfyUI server with no-cache headers. Swap any WAV keeping the filename and it takes effect on refresh. The pack deliberately excludes Sounds from updates so your files survive git pull.

      No WAV, or no user gesture yet (browsers won't start audio until you click something)? It synthesises tones instead. SND toggles it, and the little slider next to it persists per game.

      If it doesn't work

      • Blank node: the JS needs addDOMWidget from a current ComfyUI frontend. On an older build it retries for two seconds and then logs addDOMWidget unavailable after 2 seconds. Update ComfyUI.
      • Rendering looks mangled: ComfyUI's Nodes 2.0 frontend rewrite moved the node system off the LiteGraph canvas and broke a lot of packs that patch it - DOM-widget nodes are exactly that kind of pack. If it draws strangely, switch back to the legacy canvas and see.
      • Keys do nothing: the game doesn't have focus. Click the black play area first; that also unlocks audio.
      • High score reset: it's localStorage (comfyLunarLanderHighScore), so it's per browser and per origin. A refresh also wipes an in-progress game.
      • Browser: Chrome and Edge are what the author tested. Firefox and Safari are unsupported in practice.
      CategoryURN Arcade Games

      Inputs (0)

      No inputs

      Outputs (0)

      No outputs