Documentation menu

Advanced Features

Game Development Patterns

The practical patterns behind every MAKO example game — delta time, collision, and pathfinding-driven AI.

New to coding?

Copy the examples exactly first. Run them. Then change one number or word and run them again. You are not expected to memorize the command lists.

1

Delta time — never move per frame

Movement scaled by delta() gives the same real-world speed at any frame rate.

Try this code
x = x + 4;             // BAD — speed changes with FPS
x = x + 240 * dt;      // GOOD — 240 px/sec always
2

Collision helpers

2D and 3D, all built in — no imports needed.

Try this code
rects_overlap(x,y,w,h, x2,y2,w2,h2)
circles_overlap(x,y,r, x2,y2,r2)
box3d_overlap(min1,max1, min2,max2)
point_in_rect(px,py, x,y,w,h)
3

Monster AI with A* and vision

find_path plus line_of_sight are enough for a real state-machine enemy: patrol, chase, search.

Try this code
path = find_path(grid, mx,my, px,py);   // A* over a wall grid
sees = line_of_sight(grid, mx,my, px,py); // can it actually see you?