Click the yellow ball, not the red one. Press L to activate hard mode. In hard mode, if the red ball touches the yellow ball, you lose. Click the green flag again if there are bugs such as losing immediately.
Notes: There are bugs and the coding took an hour. I knew scratch.