当前位置: 首页>>代码示例>>Python>>正文


Python Score.show_score方法代码示例

本文整理汇总了Python中score.Score.show_score方法的典型用法代码示例。如果您正苦于以下问题:Python Score.show_score方法的具体用法?Python Score.show_score怎么用?Python Score.show_score使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在score.Score的用法示例。


在下文中一共展示了Score.show_score方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Vec2D

# 需要导入模块: from score import Score [as 别名]
# 或者: from score.Score import show_score [as 别名]

#.........这里部分代码省略.........
                color_points.append(ball.points)
                if self.turn.target != COLOR_TARGET:
                    self.foul = True
            if isinstance(ball, balls.RedBall):
                if self.turn.target != RED_TARGET:
                    self.foul = True
                red_ball += 1
                points += ball.points
            ball.velocity = Vec2D(0, 0)
            if isinstance(ball, balls.RedBall):
                self.all_balls.remove(ball)
                ball.is_potted = False
            else:
                self.ball_return(ball)
            ball.is_potted = False
        self.potted = []
        if color_ball > 1 or (red_ball > 0 and color_ball > 0):
            self.foul = True
        if self.foul is True:
            # print("Foul wrong ball potted")
            self.change_turn()
            if max(color_points) > FOUL_POINTS:
                self.turn.points += max(color_points)
            else:
                self.turn.points += FOUL_POINTS
        else:
            if self.turn.target == RED_TARGET:
                self.turn.points += points
            else:
                self.turn.points += max(color_points)
            self.turn.change_target()

    def game_handler(self):
        self.score.show_score(self.first_player, self.second_player, self.turn)
        self.ball_update()
        self.if_statick_board()
        self.check_condition()
        self.foul = False
        if self.board_status == STATICK:
            if not self.hitted_balls and self.hit is True and not self.potted:
                self.change_turn()
                self.turn.points += FOUL_POINTS
                # print("Foul no ball hit")
            self.hit = False
            self.cue_handler()
            if self.hitted_balls:
                if self.condition == STILL_RED:
                    if (isinstance(self.hitted_balls[0], balls.ColorBall) and self.turn.target != COLOR_TARGET) or (
                        isinstance(self.hitted_balls[0], balls.RedBall) and self.turn.target != RED_TARGET
                    ):
                        if not self.potted:
                            self.foul = True
                            self.change_turn()
                            # print("Foul wrong ball hit")
                            if self.hitted_balls[0].points > FOUL_POINTS:
                                self.turn.points += self.hitted_balls[0].points
                            else:
                                self.turn.points += FOUL_POINTS
                        else:
                            self.foul = True
                            points = [self.hitted_balls[0].points]
                            self.potted_ball_handler(self.potted, color_points=points)
                    if self.potted and self.foul is not True:
                        self.potted_ball_handler(self.potted)
                    elif self.foul is not True:
                        # print("No ball poted")
开发者ID:proekt-po-python,项目名称:Snooker-master-proekt-po-python,代码行数:70,代码来源:game.py


注:本文中的score.Score.show_score方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。