Removed the onresize handler and passed the ratio object to the #drawInContext function.
Fixed a misplaced ratio scaling in #checkForCollisions and used it in #drawInContext.