Just use the right/left arrow keys to avoid being hit as long as possible.
This was the first scratch game I tried to make, and I recently thought it would be fun to try to re-create it.