A camera is just an (x,y) offset subtracted from world positions before drawing. Smooth follow lerps toward the target, screen shake adds temporary random offset, zoom scales a rendered surface, and parallax scrolls background layers at a fraction of the camera's speed.
1-B 2-B 3-A 4-A | 5 random 6 20 7 = def apply(self, pos): return pos - self.offset 8 = the mini-map needs to fit the whole level in a small corner of the screen, so positions must be scaled down by a much larger factor than the 1:1 main camera view uses 9 = decaying magnitude makes the shake feel like it's settling down naturally after an impact, rather than an abrupt, jarring on/off toggle | 10 = compute the shake offset once per frame (a small random vector), then ADD it to camera.offset itself (not to each layer separately) — since every layer's draw position is derived from the same shared camera.offset, adding shake to that one value automatically shakes every layer together in sync