You automatically start on push mode. Click the player or Z to toggle between push and pull. You can’t push more than 1 block, or pull if there is a block in front of you. Click the direction of the screen you want to move in or use arrow keys.
After copying the code from @MINGCHIGO, I added a pulling interaction. You can make your own levels by inputting the x and y positions of each block. I might make actual levels sometime.