I tried using Stencyl but I couldn't wrap my head around its lego-block "coding" system, which made me sad since it seems like a pretty solid tool. Kudos to you for powering through it.
A square detector seems like a perfectly fair way to go around it. You need a way to confirm "is there a thing in front of me?" A box in front of you that detects if there's a thing seems like, well, the solution.
Your trees seem... upset.