ilusm.dev

gam

Game development: loop, sprites, physics, input, audio.

Load with: use gam

Quick example

use gam

result = gamne("value", "value", "value")
prn(result)

Functions

Game context

gamne(w, h, opts)

Creates a new instance. Takes w, h, opts.

Canvas/WebGL setup

gamnt(g, cnvs)

Performs the operation. Takes g, cnvs.

gamgl(g, cnvs)

Performs the operation. Takes g, cnvs.

Game loop

gamrn(g)

Performs the operation. Takes g.

gmstp(g)

Performs the operation. Takes g.

gamps(g)

Performs the operation. Takes g.

gamrs(g)

Resets. Takes g.

Loop control

gamnp(g, cb)

Performs the operation. Takes g, cb.

gmndr(g, cb)

Performs the operation. Takes g, cb.

Rendering

gmcl0(g)

Performs the operation. Takes g.

gamcm(g, x, y, z)

Performs the operation. Takes g, x, y, z.

gmscn(g, sc)

Performs the operation. Takes g, sc.

Sprites

gmsp1(path, w, h)

Performs the operation. Takes path, w, h.

gmsp0(s, r, c)

Performs the operation. Takes s, r, c.

gmspr(g, s, x, y, opts)

Processes or prints. Takes g, s, x, y, opts.

Animation

gmnmn(name, frms, fps)

Performs the operation. Takes name, frms, fps.

gmnmd(s, an)

Performs the operation. Takes s, an.

gmnms(s, nm)

Performs the operation. Takes s, nm.

gmnmp(s, dt)

Performs the operation. Takes s, dt.

Physics

gmbdn(x, y, w, h, dyn)

Performs the operation. Takes x, y, w, h, dyn.

gmbdp(b, x, y)

Performs the operation. Takes b, x, y.

gmbdv(b, vx, vy)

Performs the operation. Takes b, vx, vy.

gmbdc(b, ax, ay)

Performs the operation. Takes b, ax, ay.

gmph0(b, dt)

Performs the operation. Takes b, dt.

gmphy(b, g)

Performs the operation. Takes b, g.

Collision

gmcla(a, b)

Performs the operation. Takes a, b.

gmclc(a, b)

Performs the operation. Takes a, b.

gmclr(a, b)

Performs the operation. Takes a, b.

Input

gamky(g, k)

Performs the operation. Takes g, k.

gmkyp(g, k)

Performs the operation. Takes g, k.

gmkyr(g, k)

Performs the operation. Takes g, k.

gmmbt(g, b)

Performs the operation. Takes g, b.

gmmmv(g)

Performs the operation. Takes g.

gmnky(g, k, cb)

Performs the operation. Takes g, k, cb.

gmnbt(g, b, cb)

Performs the operation. Takes g, b, cb.

Tilemap

gmmpn(tw, th, w, h)

Performs the operation. Takes tw, th, w, h.

gmmps(m, x, y, t)

Performs the operation. Takes m, x, y, t.

gmmpg(m, x, y)

Performs the operation. Takes m, x, y.

gmmpd(g, m)

Performs the operation. Takes g, m.

Particles

gmpt1()

Performs the operation.

gmptc(p, x, y, vx, vy, life, col)

Performs the operation. Takes p, x, y, vx, vy, life, col.

gmpt2(p, dt)

Performs the operation. Takes p, dt.

gmpt0(g, p)

Performs the operation. Takes g, p.

Audio

gmsnd(g, path)

Performs the operation. Takes g, path.

gmply(g, s)

Performs the operation. Takes g, s.

gamlp(g, s)

Performs the operation. Takes g, s.

Camera

gamlk(g, tgt)

Performs the operation. Takes g, tgt.

gamzm(g, z)

Performs the operation. Takes g, z.

Utils

gmdst(a, b)

Sets a value or starts a process. Takes a, b.

gamng(a, b)

Performs the operation. Takes a, b.

gmlrp(a, b, t)

Performs the operation. Takes a, b, t.

gmclm(v, lo, hi)

Returns limits or constraints. Takes v, lo, hi.

Notes

  • Game loop, input, and scene management.