Hi BiggerBrain, thanks for playing!
To avoid being killed by a tank on top of your tank, you can upgrade your body damage. That way, the enemy tank will lose life quickly when it is on top of your tank!
Upgrading max life and life regen will also help a bit to avoid being killed that way.
I programmed the game to avoid a tank appearing too near your tank, but if the tank is faster than you, it will reach you very fast and you will not be able to evade it if your tank is slower.
Maybe I can program the enemy to never become too near your tank, but in that case I would need to remove the "body damage" upgrade, because this upgrade would not make sense anymore.
I also will continue improving the AI in future updates.
Thanks for the feedback!