def __init__(self, screenSize, material):
     MiniGame.__init__(self, screenSize, material)
     self.questions = [self.make_question(i) for i in range(len(self.materialCopy))] #convert the material into a form the game can use
     self.questionNum = 0 #the index of the current question
     random.shuffle(self.questions) #randomize the order in which the questions appear
     self.font = pygame.font.Font(pygame.font.get_default_font(), 12) #the font with which to render all text
     self.defender = Defender(self.font, self.screenSize) #the player-controlled defender, see Invader.py
     self.score = 0 #the player's score
     self.pointsMultiplier = 255 #a score modifier that decreases over time
Beispiel #2
0
 def __init__(self, screenSize, material):
     MiniGame.__init__(self, screenSize, material)
     self.score = 0
     self.linesWrong = []
     self.currentLine = False
     self.mousePressed = False
     positionQ = [(QABORDER+(num%2)*self.screenSize[0]/2,64*(num/2)+16) for num in range(len(self.material))]
     positionA = [(QABORDER+(num%2)*self.screenSize[0]/2,screenSize[1]/2+64*(num/2)+16) for num in range(len(self.material))]
     shuffle(positionQ)
     shuffle(positionA)
     self.qas = [QA(self.screenSize,self.material[i][0],self.material[i][1][0],positionQ[i],positionA[i]) for i in range(len(self.material))]
     self.run = True