Click and hold to control the beetles. Press W to place the glass of water at your mouse. Press B to place the bread at your mouse. Adjust target FPS for the desired FPS. Adjust clones for the desired number of beetle clones on screen.
Inspired by the Scratch Project: GameTICK API. First real attempt at something like this. Probably not perfect at all. This engine have everything you need to monitor and even control FPS to a > certain extent <. The FPS controlling part relies on the idea that the frequency of running a script significantly influences the FPS. The variables at the bottom left are individual frame times and overall update frequency.