When green flag is clicked, the flood gate opens. Then, the water rises and the floodgate closes. When space is clicked, the water level decreases and the floodgate opens again.