MALDA™ Reference Manual

The AI-First Programming Language - Version 1.0.39

39. Appendix: GPU Billiards

This appendix is a browser showcase, not the games chapter. The language contract is 28.9–28.10; the catalog is 35.3. It hosts the compiled JavaScript for Examples/Games/three_shader_billiards.malda. The kernel is still @shader() GLSL; host MALDA steps 2D physics and pushes ball and cue uniforms. Print omits the playable frame.

39.1 Playable table

Needs WebGL. Click inside the frame so mouse and keyboard reach the demo. Hold click or Space to charge, then release to shoot. The demo UI stays in English.

39.2 Controls

39.3 Rebuild the committed script

Do not hand-edit ReferenceManual/three_shader_billiards.js. Change the .malda source and compile into a throwaway folder — malda compile --mode js -o also writes index.html beside the script, so do not target ReferenceManual/ directly:

malda compile Examples/Games/three_shader_billiards.malda --mode js -o artifacts/billiards-appendix/three_shader_billiards.js
cp artifacts/billiards-appendix/three_shader_billiards.js ReferenceManual/three_shader_billiards.js

A content guard fails if that file drifts from a fresh transpile (the source-map comment the CLI appends is ignored). Local browsing from the repo root loads three.min.js and malda-js-runtime.js from Examples/Web/wwwroot/. GitHub Pages copies those two files next to this chapter.