Made functions in Graphics module to update the pixel array which will be drawn out to screen, while detecting collisions.