The objective of the game is to shoot the armed invaders and prevent them from destroying your base. You can buy several upgrades to your defenses as you finish levels.
If you are having a hard time, a good strategy is to buy one weapon upgrade after level one, then save your money for an additional turret. Buy it before you reach level four so you can guard both flanks. Enjoy!