def frame(self, delta): Mode.frame(self, delta) player = self.game.player() if player: self.score_layer.setText('%02d' % player.score) self.player_layer.setText(player.name) self.ball_layer.setText('Ball %s' % self.game.current_ball) else: self.player_layer.setText('Game over') self.ball_layer.setText('Game over')
def frame(self, delta): Mode.frame(self, delta) if self.waiting: return bonus = self.ordered_bonuses[self.current_bonus_index] value = self.bonuses[bonus] bonus_str = '%s: %s' % (bonus, value) self.ms_since_bonus_displayed += delta*1000 last_letter = int(self.ms_since_bonus_displayed/self.ms_per_letter) if last_letter > len(bonus_str): last_letter = len(bonus_str) self.delay('next', 1.25, self.nextBonus) self.waiting = True partial_bonus_str = bonus_str[0:last_letter] self.bonus_layer.setText(partial_bonus_str)
def frame(self, delta): Mode.frame(self, delta) self.lightshow.frame(delta)