Just what was Megatron doing sat in the alley?

I have a question - apologies if i've missed something glaringly obvious.
When Carly goes to talk to Megatron, he is sat in an Alley against a wall, apparently injured or just relaxing?
What was he doing?
The only reason i can thing of was that when he was on the building with Sentinel, SP grabbed his head and tore a small piece of it away, saying he was "Working with him, but never for him"
Could it be this, combined with Prime blasting the pillar that caused Megatron to get out of the way or fall off the building?
When Carly goes to talk to Megatron, he is sat in an Alley against a wall, apparently injured or just relaxing?

What was he doing?
The only reason i can thing of was that when he was on the building with Sentinel, SP grabbed his head and tore a small piece of it away, saying he was "Working with him, but never for him"
Could it be this, combined with Prime blasting the pillar that caused Megatron to get out of the way or fall off the building?