reference / collision
contact
Where two shapes touch: a record with point, normal (the way to move the first to part them) and depth, every field 0 when they do not.
ball = { pos: { 200, 120 }, radius: 40 }floor_box = { pos: { 0, 150 }, size: { 400, 150 } }c = contact ball floor_boxprint c.normalprint c.depthIt prints
{ 0, -1 }
10How to write it
contact a b
Gives a value.