gameV4.py
def __init_text(self):
        '''Inisialisasi tulisan yang berupa jumlah Quanta yang tersisa di setiap tumpukan'''
        pygame.font.init()
        myfont = pygame.font.SysFont('Comic Sans MS',20,'bold')

        text1 = myfont.render("PileA:", True, (255,0,0))
        sum1 = myfont.render(str(self.pile1),True, (255,0,0))
        pygame.draw.rect(self.display, (255,255,255), (280, 70, 65, 55))
        self.display.blit(text1, (280, 70))
        self.display.blit(sum1, (300, 90))

        text2 = myfont.render("PileB:", True, (255,0,0))
        sum2 = myfont.render(str(self.pile2),True, (255,0,0))
        pygame.draw.rect(self.display, (255, 255, 255), (380, 70, 65, 55))
        self.display.blit(text2, (380, 70))
        self.display.blit(sum2, (400, 90))

        text3 = myfont.render("PileC:", True, (255,0,0))
        sum3 = myfont.render(str(self.pile3),True, (255,0,0))
        pygame.draw.rect(self.display, (255, 255, 255), (480, 70, 65, 55))
        self.display.blit(text3, (480, 70))
        self.display.blit(sum3, (500, 90))

        text4 = myfont.render("PileD:", True, (255,0,0))
        sum4 = myfont.render(str(self.pile4),True, (255,0,0))
        pygame.draw.rect(self.display, (255, 255, 255), (580, 70, 65, 55))
        self.display.blit(text4, (580, 70))
        self.display.blit(sum4, (600, 90))

        pygame.display.update()
Inisialisasi tulisan yang berupa jumlah Quanta yang tersisa di setiap tumpukan
Inisialisasi tulisan yang berupa jumlah Quanta yang tersisa di setiap tumpukan
Inisialisasi tulisan yang berupa jumlah Quanta yang tersisa di setiap tumpukan
def __init_text(self):
        pygame.font.init()
        myfont = pygame.font.SysFont('Comic Sans MS',20,'bold')
        text1 = myfont.render("PileA:", True, (255,0,0))
        sum1 = myfont.render(str(self.pile1),True, (255,0,0))
        pygame.draw.rect(self.display, (255,255,255), (280, 70, 65, 55))
        self.display.blit(text1, (280, 70))
        self.display.blit(sum1, (300, 90))
        text2 = myfont.render("PileB:", True, (255,0,0))
        sum2 = myfont.render(str(self.pile2),True, (255,0,0))
        pygame.draw.rect(self.display, (255, 255, 255), (380, 70, 65, 55))
        self.display.blit(text2, (380, 70))
        self.display.blit(sum2, (400, 90))
        text3 = myfont.render("PileC:", True, (255,0,0))
        sum3 = myfont.render(str(self.pile3),True, (255,0,0))
        pygame.draw.rect(self.display, (255, 255, 255), (480, 70, 65, 55))
        self.display.blit(text3, (480, 70))
        self.display.blit(sum3, (500, 90))
        text4 = myfont.render("PileD:", True, (255,0,0))
        sum4 = myfont.render(str(self.pile4),True, (255,0,0))
        pygame.draw.rect(self.display, (255, 255, 255), (580, 70, 65, 55))
        self.display.blit(text4, (580, 70))
        self.display.blit(sum4, (600, 90))
        pygame.display.update()
def __init_text ( self ) : pygame . font . init ( ) myfont = pygame . font . SysFont ( 'Comic Sans MS' , 20 , 'bold' ) text1 = myfont . render ( "PileA:" , True , ( 255 , 0 , 0 ) ) sum1 = myfont . render ( str ( self . pile1 ) , True , ( 255 , 0 , 0 ) ) pygame . draw . rect ( self . display , ( 255 , 255 , 255 ) , ( 280 , 70 , 65 , 55 ) ) self . display . blit ( text1 , ( 280 , 70 ) ) self . display . blit ( sum1 , ( 300 , 90 ) ) text2 = myfont . render ( "PileB:" , True , ( 255 , 0 , 0 ) ) sum2 = myfont . render ( str ( self . pile2 ) , True , ( 255 , 0 , 0 ) ) pygame . draw . rect ( self . display , ( 255 , 255 , 255 ) , ( 380 , 70 , 65 , 55 ) ) self . display . blit ( text2 , ( 380 , 70 ) ) self . display . blit ( sum2 , ( 400 , 90 ) ) text3 = myfont . render ( "PileC:" , True , ( 255 , 0 , 0 ) ) sum3 = myfont . render ( str ( self . pile3 ) , True , ( 255 , 0 , 0 ) ) pygame . draw . rect ( self . display , ( 255 , 255 , 255 ) , ( 480 , 70 , 65 , 55 ) ) self . display . blit ( text3 , ( 480 , 70 ) ) self . display . blit ( sum3 , ( 500 , 90 ) ) text4 = myfont . render ( "PileD:" , True , ( 255 , 0 , 0 ) ) sum4 = myfont . render ( str ( self . pile4 ) , True , ( 255 , 0 , 0 ) ) pygame . draw . rect ( self . display , ( 255 , 255 , 255 ) , ( 580 , 70 , 65 , 55 ) ) self . display . blit ( text4 , ( 580 , 70 ) ) self . display . blit ( sum4 , ( 600 , 90 ) ) pygame . display . update ( )
Inisialisasi tulisan yang berupa jumlah Quanta yang tersisa di setiap tumpukan
Inisialisasi tulisan yang berupa jumlah Quanta yang tersisa di setiap tumpukan
'''Inisialisasi tulisan yang berupa jumlah Quanta yang tersisa di setiap tumpukan'''
self