 
 
 @mousedown = (e) ->
-  app.events.handle_mousedown(e)
+  @app.events.handle_mousedown(e)
 
 
 @mouseup = (e) ->
-  app.events.handle_mouseup(e)
+  @app.events.handle_mouseup(e)
 
 
 @mousemove = (e) ->
-  app.events.handle_mousemove(e)
+  @app.events.handle_mousemove(e)
 
 
 get_puzzle_pattern = (app) ->


class MissingPiecesMask

  constructor: (puzzle_app, grid) ->
    @puzzle = puzzle_app
    @puzzle_pattern = @puzzle.puzzle_pattern
    @grid = grid
    @hex_draw = @puzzle.hex_draw
    @reset_mask()

  reset_mask: () ->
    console.log " BEGIN  MissingPiecesMask#reset_mask()"
    @puzzle.puzzle_view.draw_photo()
    @get_next_color()
    @draw_mask()
    console.log " END    MissingPiecesMask#reset_mask()"





start = () ->
  @app = new PuzzleApp()


window.onload = start
