It works best in full screen. Sometimes it glitches a bit. Press the up arrow once at the beginning of every level before you start moving (or it won't work). Use the arrow keys to move. Press the flag twice if the timer doesn't start. Reach the portal to complete each level. Don't touch the plants.
Thanks to @26JLE for some of the code.