10 Incredibly Subtle Ways Movies Gave Away Their Endings
4. A Lazy SHIELD Employee Reveals The Alien Invasion - The Avengers
There was a time when the first Avengers movie was going to feature the Hulk as the villain (it was even set up in the post-credits stinger on The Incredible Hulk), but plans changed and ultimately Loki turned out to be the big bad. He was never going to be enough on his own, of course, so Joss Whedon tacked on a relationship with the Chitauri (as sponsored by Thanos) who would be his cannon fodder/army to help his invasion agenda.
That third act escalation mostly came out of nowhere - particularly as it meant the Avengers would have to lose a little to get there - but it was heavily foreshadowed in the first scene that sees the Avengers all together as a unit (minus the possessed Hawkeye, of course).
When Tony Stark enters the bridge of the SHIELD helicarrier, he quips that one of the vessel's crew is playing Galaga, the classic arcade game. Putting aside the gross misconduct on display, the game actually teases Loki's invasion as its story involves the player defending Earth from invading aliens dropping out of the sky. Clever that.