I found the following book insightful, in understanding some of the concepts involved in simulating physics and "life-like" behaviors.
The Nature of Code: Simulating Natural Systems with Processing - Daniel Shiffman
You can read the entire book online here: https://natureofcode.com/book/