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


Python Score.returnScore方法代码示例

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


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

示例1: PlayScreen

# 需要导入模块: from score import Score [as 别名]
# 或者: from score.Score import returnScore [as 别名]
class PlayScreen(object):
    def __init__(self):
        '''
        PLAY SCREEN INIT
        '''
        # Init the font
        self.largefont = pygame.font.SysFont("Impact", 20)
        self.smallfont = pygame.font.SysFont("Impact", 15)

        # Load all graphics for the screen
        self.playbg = createGraphics("img/play_bg.png", 0,0)            # load the backgorund   
        self.pause = createGraphics("img/pause.png", 745,450)           # load the pause button
        self.mute = createGraphics("img/mute.png", 745,496)             # load the mute button
        self.undo = createGraphics("img/undo.png", 745,542)             # load the undo button
        self.deck = createGraphics("img/deck.png", 21,449)              # load the deck graphic
        self.menubg = createGraphics("img/pause_menu_bg.png", 223,70)   # load the pause menu popup 
        self.playOn = createGraphics("img/halda_afram.png", 242,99)     # load the play on button in menu
        self.playAgain = createGraphics("img/byrja_aftur.png", 242,211) # load the play again button in menu
        self.stopGame = createGraphics("img/haetta_leik.png", 242,323)  # load the stop game button in menu
        self.endscreen = createGraphics("img/lose_bg.png", 0,0)         # load the loose screen 
        self.winscreen = createGraphics("img/win_bg.png", 0,0)          # load the win screen
        self.register_bg = createGraphics("img/register_bg.png", 0,0)       # load the top 10 register screen
        self.view_toplist = createGraphics("img/view_toplist.png", 262,363)     # load the view top list button

        # For music player
        self.last_song = createGraphics("img/last_song.png", 356,7)
        self.play_song = createGraphics("img/pause_song.png", 381,7)
        self.next_song = createGraphics("img/next_song.png", 412,7)

        self.song = 0
        self.initPlayer = True

        # place cards on table in first iteration
        self.initBoardMode = True

        self.sound = True 
        self.i = 0 

        self.j = 0

        play = Sound() 

        #card taken from deck
        self.lastStock = False

        '''
        CARDS INIT
        '''
        self.suits = 'hsdc'     #hearts, spades, diamonds, clubs
        self.ranks = '23456789TJQKA'    # all card types
        cardslist = [rank + suit for suit in self.suits for rank in self.ranks] # create dummy deck
        self.cardsImg = {}  # list that will contain all card graphics

        # create card graphic for every card in cardslist and put into self.cardsImg
        for card in cardslist: 
            self.cardsImg[card] = createGraphics("img/cards/" + card + ".png",0,0)

        '''
        DRAGMODE INIT
        '''
        self.mouseInDeck = False
        self.dragmode = False
        self.selectedCard = None
        self.selectedCardOrigPosL = None
        self.selectedCardOrigPosT = None
        self.displayMenu = False

        '''
        SCORE INIT
        '''
        self.score = Score()
        self.currentScore = self.largefont.render(str(self.score.returnScore()), 1, (255,255,255))
        self.currentScoreRect = self.currentScore.get_rect()
        self.currentScoreRect = self.currentScoreRect.move(20,8)
        
        # count successful moves in a row
        self.combo = 0

        # finalTime is set when game ends and is sent to high score etc
        self.finalTime = 0

        # Controls if to dispaly end screens or not
        self.displayLoseScreen = False
        self.displayWinScreen = False
        self.checkGameStatus = True

        self.gameResults = False

        '''
        TIME INIT
        '''
        # Time since program was executed
        self.startTime = pygame.time.get_ticks()

        # Time in pause mode
        self.pauseTime = 0

        # Object to write time to screen
        self.displayTime = self.smallfont.render('Tími: ' + str(pygame.time.get_ticks() - self.startTime), 1, (255,255,255))
        self.displayTimeRect = self.displayTime.get_rect()
#.........这里部分代码省略.........
开发者ID:EliasJonsson,项目名称:Golf-Solitaire,代码行数:103,代码来源:Screens.py


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