This is a demonstration of how to add physics to a Simple 2D / SDL application using Chipmunk.
First, install dependencies. On macOS with Homebrew, install Simple 2D (see the README for other OSes):
$ brew tap simple2d/tap && brew install simple2d
Install Chipmunk, for example:
$ brew install chipmunk
Build and run using make
Click in the window to subtract x and y velocity from ball.