Extract addition of obstacles into a method in level.js
Extract collision checking into a method in the Player class
Separate drawing and collision detection into two separate loops