def __init__(self, campaign, result): Clock.getInstance().attach(self) self.campaign = campaign self.result = result
from warzone import WarZoneController import gc from datetime import datetime from graphics import Graphics from collision import CollisionController from clock import Clock from scorecard import ScoreCard keys = [False, False] missiles = [] graphics = Graphics.getInstance() tank = Tank.getInstance() warZoneController = WarZoneController.getInstance() scoreCard = ScoreCard.getInstance() collisionController = CollisionController.getInstance() clock = Clock.getInstance() exitCode = 0 running = 1 startTime = datetime.now() oldTime = startTime enemyInterval = 2 # 5 seconds interval for enemy gameDuration = 45 # 30 seconds game while running: gc.collect() graphics.makeField() tank.displayTank() tankPosition = tank.getTankPosition() for event in pygame.event.get():