width=100 height=50 --print("pixels:", pixels) repaint=not notFirstTime notFirstTime=true pixels=nil -- optimization (no redraw effort if image not changed) if inputEvents then for _, e in ipairs(inputEvents) do --print(e[1]) if e[1] == 'mousePressed' then mouse = true repaint = true elseif e[1] == 'mouseReleased' then mouse = false repaint = true end end end if repaint then pixels = {} if mouse then for i=1, width*height do pixels[i] = -1 end end end animateAgainIn = 100