There are 2 phases, press space to shoot apple and q for barrier. You may have to press the flag twice.
Barrier only works against apples, not the cat and the apples firing at you are a little weird. Also, very hard. A warning, don't click hard mode.