different methods for writing obstacle-pixels in javascript-file