Dodge the rocks coming down from the wall. Double click the flag. This IS possible, but it's hard. And yes, the wall is supposed to rebound you out of it it you are too far. That is so that you can't get in the edge.
I like this. Another game I made sort of like this: https://scratch.mit.edu/projects/382556832