Released in 1982, Star Wars: The Empire Strikes Back would be the first Star Wars licensed game. The game had only two end conditions, either the player ran out of lives or an AT-AT would get to the base and destroy it.
Star Wars: The Empire Strikes Back (video game) on Wikipedia
Gameplay by Highretrogamelord via Youtube