Game logic for an tower defense game in java.