Update javascript.js

This version takes out randomBarrier receiving an argument--because I couldn't get it to work properly, but it stores the respective image in the class of the object, and draws based on the object being stored in coordinates.