示例#1
0
 def display(self):
     g.screen.fill(utils.WHITE)
     if g.toc_showing:
         g.screen.blit(self.toc.surf, (g.offset, 0))
         buttons.draw()
         return
     g.screen.blit(self.layout.surf, (g.offset, 0))
     if g.jig:
         self.jig.draw()
     if g.mouse_locn:
         x, y = pygame.mouse.get_pos()
         m = '(' + str(x) + ',' + str(y) + ')'
         cxy = (g.sx(29), g.sy(1.2))
         utils.message(g.screen, g.font1, m, cxy, 5)
     if g.colors:
         g.screen.blit(g.colors_img, g.colors_xy)
         if utils.mouse_on_img(g.colors_img, g.colors_xy):
             c = g.screen.get_at(pygame.mouse.get_pos())
             r, g1, b = '0', '0', '0'
             if c[0] > 200: r = '255'
             if c[1] > 200: g1 = '255'
             if c[2] > 200: b = '255'
             m = '(' + r + ',' + g1 + ',' + b + ')'
             cxy = (g.sx(5.3), g.sy(19.5))
             utils.message(g.screen, g.font1, m, cxy, 5)
     if self.layout.movie != None: self.layout.movie.draw()
     buttons.on(['fd', 'back'])
     if g.page == 1: buttons.off('back')
     elif g.page == g.last_page: buttons.off('fd')
     buttons.draw()
     if g.rect_on:
         pygame.draw.rect(g.screen, utils.GREEN, g.rect)
     if self.popup != None:
         surf, x, y = self.popup
         g.screen.blit(surf, (x, y))
示例#2
0
 def display(self):
     g.screen.fill((220, 64, 64))
     g.grid.draw()
     buttons.draw()
     x = 5
     cy = g.sy(3)
     np = g.grid.counts[1]
     nw = g.grid.counts[2]
     if nw > 0:
         utils.display_number(nw, (g.sx(x), cy), g.font2, utils.ORANGE)
     if np > 0:
         utils.display_number(np, (g.sx(32 - x), cy), g.font2, utils.CYAN)
     x = 3.3
     cy = g.sy(13.2)
     if g.lost > 0: utils.display_number(g.lost, (g.sx(x), cy), g.font1)
     cy = g.sy(14.6)
     if g.won > 0: utils.display_number(g.won, (g.sx(32 - x), cy), g.font1)
     cy = g.sy(18.7)
     img = g.magician
     if g.state != 2: img = g.magician_grey
     utils.centre_blit(g.screen, img, (g.sx(x), cy))
     img = g.xo2
     if g.state != 1: img = g.xo2_grey
     utils.centre_blit(g.screen, img, (g.sx(32 - x), cy))
     cy = g.sy(9)
     if g.result != None:  # smiley
         utils.centre_blit(g.screen, g.result, (g.sx(32 - x), cy))
 def display(self):
     if self.tessl.complete():
         g.screen.fill((0, 0, 0))
     else:
         cols = [(128, 0, 128), (255, 255, 192), (0, 255, 0), (0, 255, 0),
                 (128, 0, 128)]
         cols += [(0, 255, 0), (0, 0, 255), (255, 193, 127),
                  (255, 255, 255), (0, 0, 0)]
         cols += [(255, 255, 192), [0, 0, 0]]
         g.screen.fill(cols[g.tesses[g.tess_n - 1] - 1])
     self.tessl.draw()
     pygame.draw.rect(g.screen, (0, 0, 0),
                      (g.sx(0), g.sy(21.55), g.sy(32), g.sy(2.55)))
     if self.tessl.complete():
         if g.max_n < g.tess_n:
             g.max_n = g.tess_n
             self.max_n = g.max_n
         utils.centre_blit(g.screen, g.magician, (g.sx(16.6), g.sy(16.9)))
         g.button_display = True
     if self.tessl.carrying: g.button_display = False
     self.buttons_control()
     buttons.draw()
     x = g.sx(.2)
     y = g.sy(.2)
     s = str(g.tess_n) + ' / ' + str(len(g.tesses)) + '  (' + str(
         g.max_n) + ')'
     utils.display_string(s, (x, y))
示例#4
0
 def display(self):
     if g.menu:
         g.screen.fill((125,0,0))
         g.screen.blit(g.bgd,(g.offset,0))
         self.menu_hide()
         menu_tablet.draw()
     elif g.help1:
         g.screen.fill((0,0,124))
         self.chess.help1()
     else:
         g.screen.fill((192,255,255))
         self.chess.draw()
         if g.state in (1,2): tablet.draw()
         if self.chess.layout>6: # draw black/white "whose move?" circle
             img=None
             if g.state==1: img=g.w_img
             if g.state==2: img=g.b_img
             if g.state==6: img=g.smile
             if g.state==7: img=g.frown
             if img!=None: utils.centre_blit(g.screen,img,g.bw)
         if self.chess.layout not in (11,13,15,17):
             l=self.chess.layout
             s=self.chess.layout_scores[l]
             both=False
             if g.top==19 or g.top>l: both=True
             img=g.ghost
             for ind in range(2):
                 if ind==0:
                     if s>0 or both: img=g.star
                 else:
                     if s==1 and not both: img=g.ghost
                 utils.centre_blit(g.screen,img,g.star_c[ind])
     buttons.draw()
示例#5
0
 def display(self):
     g.screen.fill(utils.BLACK)
     self.board.draw()
     utils.display_number(g.score, (g.sx(22.6), g.yc), g.font2, utils.CREAM)
     utils.centre_blit(g.screen, g.star, (g.sx(27.6), g.yc))
     utils.display_number1(g.best, (g.sx(28.6), g.yc), g.font2, utils.CREAM)
     buttons.draw()
 def display(self):
     g.screen.fill((255, 255, 192))
     g.screen.blit(g.bgd, (g.x0, 0))
     self.acr.draw()
     utils.centre_blit(g.screen, g.scores, g.scores_c)
     utils.display_number(g.score, g.score_c, g.font1)
     pygame.draw.rect(g.screen, utils.BLACK, g.vinc)
     utils.display_number(g.target, g.target_c, g.font1)
     utils.text_blit1(g.screen,g.percent,g.font1,g.percent_xy,\
                      utils.BLACK,False)
     if g.best > 0:
         s = 'Best: ' + str(g.best) + '%'
         utils.text_blit1(g.screen, s, g.font1, g.best_xy, utils.BLACK,
                          False)
     if g.count == 2:
         utils.text_blit(g.screen, 'twice', g.font3, g.count_c,
                         utils.ORANGE, False)
     if g.count > 2:
         s = str(g.count) + ' times'
         utils.text_blit(g.screen, s, g.font3, g.count_c, utils.ORANGE,
                         False)
     buttons.draw()
     if self.acr.message != None:
         utils.message1(g.screen, g.font1, self.acr.message, g.message_c)
     if g.help_on:
         utils.centre_blit(g.screen, g.help_img, g.help_cxy)
示例#7
0
 def display(self): # called each loop
     g.screen.fill((255,255,192))
     g.screen.blit(g.magician,(g.sx(0),g.sy(18.0)))
     cx=g.sx(26); cy=g.sy(5.0); utils.centre_blit(g.screen,g.target,(cx,cy));
     if g.aim>0: self.display_n_glow(g.aim,(cx,cy))
     x=g.sx(3);y=g.sy(3.0)
     pale=False
     if buttons.active('plus'): pale=True
     for i in range(len(g.top)):
         x=self.display_n(g.top[i],(x,y),True,False,pale);x+=g.sp1
     x=g.sx(3);y=g.sy(13)
     for i in range(len(g.buffr)):
         m=g.buffr[i]
         if m=='plus':
            g.screen.blit(g.plus,(x,y));x+=g.plus.get_width()
         elif m=='times':
            g.screen.blit(g.times,(x,y));x+=g.times.get_width()
         elif m=='equals':
            g.screen.blit(g.equals,(x,y));x+=g.equals.get_width()
         else:
             x=self.display_n(g.buffr[i],(x,y))
         x+=g.sp2
     buttons.draw()
     self.slider.draw()
     if self.correct(): utils.centre_blit(g.screen,g.smiley,(g.sx(16),g.sy(12)))
     if g.score>0: utils.display_score()
示例#8
0
 def display(self):
     g.screen.fill((0,0,70))
     buttons.draw()
     self.grid.draw()
     self.slider.draw()
     utils.display_number(g.score,self.score_cxy,g.font2,utils.CREAM)
     if self.grid.complete():
         utils.centre_blit(g.screen,g.smiley,self.smiley_cxy)
示例#9
0
 def display(self):
     g.screen.blit(g.sky, g.sky_xy)
     self.soko.draw()
     buttons.draw()
     s = str(g.pattern) + ' / ' + str(g.puzzles_n)
     utils.text_blit1(g.screen, s, g.font2, (g.sx(.5), g.sy(.5)),
                      utils.BLUE, False)
     if not g.demo_mode and self.soko.complete():
         utils.centre_blit(g.screen, g.smiley, g.smiley_c)
示例#10
0
 def display(self):
     g.screen.fill((0, 0, 0))
     buttons.draw()
     self.slider.draw()
     self.omm.draw()
     utils.display_number(self.omm.n, g.number_c, g.font2, self.omm.colr_n)
     s = str(len(om.found[g.level - 1])) + ' / ' + str(self.omm.total)
     utils.text_blit(g.screen, s, g.font1, g.progress_c, utils.CREAM)
     if self.omm.complete():
         utils.centre_blit(g.screen, g.smiley, g.smiley_c)
示例#11
0
 def display(self):
     g.screen.fill((0, 0, 120))
     self.som.draw()
     if self.som.complete():
         buttons.off(['cream', 'yellow'])
         buttons.on('black')
     else:
         buttons.on(['cream', 'yellow'])
         buttons.off('black')
     buttons.draw()
示例#12
0
 def display(self):
     g.screen.fill((64, 64, 255))
     self.didg.draw()
     g.screen.blit(g.surf, g.surf_xy)
     buttons.draw()
     utils.text_blit(g.screen,str(g.save_n),g.font2,\
                     self.save_c,utils.ORANGE,True)
     if g.load_n > 0:
         utils.text_blit(g.screen,str(g.load_n),g.font2,\
                         self.load_c,utils.CYAN,True)
示例#13
0
 def display(self):
     g.screen.fill((255, 255, 192))
     if g.state == 1:
         utils.centre_blit(g.screen, g.title, g.title_c)
     elif g.state == 2:
         g.title = None
         self.menu.draw()
         self.slider.draw()
     elif g.state == 3:
         self.jigsaw.draw()
     buttons.draw()
示例#14
0
 def display(self):
     grey = 100
     g.screen.fill((grey, grey, grey))
     buttons.draw()
     g.screen.blit(g.help1, g.help1_xy)
     utils.display_number(g.count, (g.xc, g.yc), g.font2, utils.CREAM)
     colour = utils.YELLOW
     if g.helped > 5: colour = utils.RED
     utils.display_number(g.helped, (g.xc, g.yc + g.sy(6)), g.font1, colour)
     if g.finished:
         utils.centre_blit(g.screen, g.smiley, (g.sx(4), g.smiley_y))
     self.board.draw()
示例#15
0
def display():
    g.screen.fill((0,255,0))
    for img in g.imgs: # img from ImgClickClass (centred)
        img.draw(g.screen)
    if g.wrong:
        img=g.imgs[g.wrong_ind]
        utils.centre_blit(g.screen,g.wrong_img,(img.cx,img.cy))
        img=g.imgs[g.right_ind]
        utils.centre_blit(g.screen,g.glow[g.right_ind],(img.cx,img.cy))
    buttons.draw()
    ladder()
    g.screen.blit(g.magician,(g.sx(3.2),g.sy(18.2)))
示例#16
0
 def display(self):
     g.screen.fill((0, 255, 255))
     utils.display_number(g.player, g.player_c, g.font3, utils.ORANGE)
     utils.display_number1(g.wizard, g.wizard_lc, g.font3, utils.ORANGE)
     img = g.xo_grey
     if g.state in (1, 2, 3): img = g.xo
     g.screen.blit(img, g.xo_xy)
     img = g.magician_grey
     if g.state in (4, 5, 6): img = g.magician
     g.screen.blit(img, g.magician_xy)
     buttons.draw()
     self.manc.draw()
示例#17
0
 def display(self,wait=False):
     g.screen.fill((0,0,100))
     if wait:
         utils.centre_blit(g.screen,g.wait,(g.sx(16),g.sy(10)))
     else:
         self.rects.draw()
     buttons.draw()
     self.slider.draw()
     if g.magic_show:
         utils.centre_blit(g.screen,g.magic,(g.sx(27.8),g.sy(3.2)))
     if g.score>0:
         x=g.sx(29.5); y=g.sy(8)
         utils.display_number(g.score,(x,y),g.font2,utils.CREAM)
示例#18
0
 def display(self):
     g.screen.fill((128, 0, 0))
     self.grid.draw()
     buttons.draw()
     g.screen.blit(g.panel, g.panel_xy)
     utils.display_number(g.count, g.count_c, g.font2, utils.CREAM)
     if self.grid.yes: utils.centre_blit(g.screen, g.yes, g.smiley_cxy)
     if self.grid.no or self.grid.count > 2:
         utils.centre_blit(g.screen, g.no, g.smiley_cxy)
     if self.grid.count > 0 and not self.grid.yes:
         utils.display_number(self.grid.count,(g.smiley_cxy[0],g.wrong_cy),\
                              g.font1,utils.RED)
     if g.ms <> None: utils.centre_blit(g.screen, g.glow, g.glow_c)
示例#19
0
 def display(self):
     if g.help_on:
         if g.help_img==None:
             g.help_img=utils.load_image('help.png')
         g.screen.blit(g.help_img,(0,0))
         return
     g.screen.fill((70,0,70))
     self.sim.draw()
     if not g.running: buttons.clear()
     buttons.draw()
     self.slider.draw()
     if g.load_n>0:
         utils.display_number(g.load_n,self.load_c,g.font1,utils.CYAN)
     utils.display_number(g.save_n,self.save_c,g.font1,utils.ORANGE)
示例#20
0
 def display(self):
     g.screen.fill(g.bgd)
     g.screen.blit(g.tscreen, g.txy)
     if g.grid_on:
         g.screen.blit(g.grid, g.txy)
         if g.grid_nos:
             g.screen.blit(g.x_nos, g.x_nos_xy)
             g.screen.blit(g.y_nos, g.y_nos_xy)
             x, y = g.txy
             utils.display_number(0, (x, y + g.side), g.font2)
     pygame.draw.rect(g.screen, (0, 0, 150), (g.txy, (g.side, g.side)), 2)
     my_turtle2.draw()
     self.panel()
     buttons.draw()
示例#21
0
文件: Letters.py 项目: i5o/letters
 def display(self):
     g.screen.fill(self.colors[1])
     if not self.sugar:
         g.screen.blit(g.bgd, (g.sx(0), 0))
     self.let.draw()
     if self.sugar:
         self.back_button.set_sensitive(False)
         self.tick_button.set_sensitive(False)
     else:
         buttons.off(['back', 'tick'])
     if g.state in (2, 4):
         if len(self.let.ans) > 0:
             if self.sugar:
                 self.back_button.set_sensitive(True)
             else:
                 buttons.on('back')
         if len(self.let.ans) > 1:
             if self.sugar:
                 self.tick_button.set_sensitive(True)
             else:
                 buttons.on('tick')
     buttons.draw()
     #utils.display_number(g.state,(10,10),g.font1)
     if g.state == 3:
         ln = len(self.let.ans)
         if ln == 2:
             s = _('Your word scores one point.')
         else:
             s = _('Your word scores %s points.' % (str(2 ** (ln - 2))))
         utils.text_blit(g.screen, s, g.font2, g.message_cxy,
                         self.colors[0], False)
     if g.state == 4:
         s = _('Sorry, %s is not in my word list' % self.let.ans)
         utils.text_blit(g.screen, s, g.font2, g.message_cxy,
                         self.colors[0], False)
     if self.sugar:
         self.label.set_markup(
             '<span><big><b> %s (%s)</b></big></span>' % (str(g.score),
                                                          str(g.best)))
     else:
         if g.score > 0:
             s = _('Total: %s' % (str(g.score)))
             utils.text_blit(g.screen, s, g.font1, g.score_cxy,
                             self.colors[0], False)
         if g.best > 0:
             s = _('Best: %s' % (str(g.best)))
             utils.text_blit(g.screen, s, g.font1, g.best_cxy,
                             self.colors[0], False)
     if g.help_on:
         utils.centre_blit(g.screen, g.help_img, g.help_cxy)
示例#22
0
 def display(self):
     if g.map1:
         self.map1.draw()
     elif g.pages:
         self.pages.draw()
     else:
         if g.offset > 0: g.screen.fill(utils.CREAM)
         g.screen.blit(g.bgd, g.xy0)
         utils.centre_blit(g.screen, g.pic, g.xyc)
         self.ctry.draw()
         if self.ctry.message != None:
             utils.message1(\
                 g.screen,g.font2,self.ctry.message,self.ctry.message_c)
     buttons.draw()
示例#23
0
    def display(self, wait=False):
        if g.state == 1:
            self.menu_display()
            #utils.display_number(g.success,(g.sx(.2),g.sy(.15)),g.font2,utils.ORANGE)
        else:
            if self.pj.complete():
                g.screen.blit(g.bgd, (g.sx(0), 0))

            else:
                #                g.screen.fill((g.red,g.green,g.blue))
                g.screen.fill(utils.CYAN)
            self.pj.draw()
            buttons.draw()
            utils.display_number(g.success, (g.sx(.2), g.sy(.3)), g.font1,
                                 utils.ORANGE)
 def display(self):  # called each loop
     if g.big:
         g.screen.fill(self.colors[1])
         utils.centre_blit(g.screen, g.big_surface, (g.sx(16), g.sy(11.5)))
     else:
         if self.sugar:
             g.screen.fill(self.colors[1])
         else:
             g.screen.blit(g.bgd, (g.sx(0), 0))
         g.screen.blit(g.box, (g.x0, g.y0))
         g.screen.blit(g.box, (g.x1, g.y1))
         if not self.sugar:
             utils.centre_blit(g.screen, g.magician, g.magician_c)
         self.draw_goal()
         utils.centre_blit(g.screen, g.turtle,
                           (g.x0 + 4 * g.dd, g.y0 + 6 * g.dd))
         self.tu.draw()
         if self.tu.win:
             if self.sugar:
                 if self.good_job is None:
                     path = self.parent.good_job_image_path()
                     self.good_job = utils.load_image(path, True)
                 if g.w > g.h:
                     utils.centre_blit(
                         g.screen, self.good_job, (g.sx(7), g.sy(17)))
                 else:
                     utils.centre_blit(g.screen, self.good_job, (g.sx(7),
                                                                 g.sy(38)))
             else:
                 utils.centre_blit(g.screen, g.smiley, (g.sx(16.6),
                                                        g.sy(2.2)))
             if self.sugar:
                 self.cyan_button.set_sensitive(True)
             else:
                 buttons.on('cyan')
             if not self.journal:
                 utils.save()
         self.draw_nos()
         if not self.sugar:
             buttons.draw()
             self.slider.draw()
         if g.score > 0:
             if self.sugar:
                 self.parent.update_score(int(g.score))
             else:
                 utils.display_score()
         utils.display_number1(g.pattern, (g.sx(2.4), g.sy(2)),
                               g.font1, utils.WHITE)
示例#25
0
 def display(self):
     g.screen.fill(self.colors[1])
     if not self.sugar:
         g.screen.blit(g.bgd, (g.sx(0), 0))
     self.let.draw()
     if self.sugar:
         self.back_button.set_sensitive(False)
         self.tick_button.set_sensitive(False)
     else:
         buttons.off(['back', 'tick'])
     if g.state in (g.STATE_PLAY, g.STATE_WRONG):
         if len(self.let.ans) > 0:
             if self.sugar:
                 self.back_button.set_sensitive(True)
             else:
                 buttons.on('back')
         if len(self.let.ans) > 1:
             if self.sugar:
                 self.tick_button.set_sensitive(True)
             else:
                 buttons.on('tick')
     buttons.draw()
     if g.state == g.STATE_RIGHT:
         ln = len(self.let.ans)
         if ln == 2:
             s = _('Your word scores one point.')
         else:
             s = _('Your word scores %s points.' % (str(2**(ln - 2))))
         utils.text_blit(g.screen, s, g.font2, g.message_cxy,
                         self.colors[0], False)
     if g.state == g.STATE_WRONG:
         s = _('Sorry, %s is not in my word list' % self.let.ans)
         utils.text_blit(g.screen, s, g.font2, g.message_cxy,
                         self.colors[0], False)
     if self.sugar:
         self.label.set_markup('<span><big><b> %s (%s)</b></big></span>' %
                               (str(g.score), str(g.best)))
     else:
         if g.score > 0:
             s = _('Total: %s' % (str(g.score)))
             utils.text_blit(g.screen, s, g.font1, g.score_cxy,
                             self.colors[0], False)
         if g.best > 0:
             s = _('Best: %s' % (str(g.best)))
             utils.text_blit(g.screen, s, g.font1, g.best_cxy,
                             self.colors[0], False)
     if g.help_on:
         utils.centre_blit(g.screen, g.help_img, g.help_cxy)
示例#26
0
 def display(self):
     g.screen.fill((0, 0, 0))
     g.level = self.levels[self.menu.green.n]
     if g.state == 'menu':
         self.menu.draw()
         n = self.slider_n()
         if n != None: self.slider[n].draw()
     else:
         self.tr[g.level].draw()
         buttons.off(['1', '2', '3', '4'])
         if not self.tr[g.level].complete():
             buttons.on(['1', '2', '3', '4'])
             g.screen.blit(g.arrows, g.arrows_xy)
         elif self.tr[g.level].success:
             utils.centre_blit(g.screen, g.smiley, g.smiley_c)
         buttons.draw()
示例#27
0
 def display(self):
     g.screen.fill(self.colors[1])
     if self.aim.running or self.aim.glow_active:
         pass
     for img in g.imgs:  # img from ImgClick (centred)
         img.draw(g.screen)
     if g.wrong:
         img = g.imgs[g.wrong_ind]
         utils.centre_blit(g.screen, g.wrong_img, (img.cx, img.cy))
         img = g.imgs[g.right_ind]
         utils.centre_blit(g.screen, g.glowy[g.right_ind], (img.cx, img.cy))
     if not self.sugar:
         buttons.draw()
         self.slider.draw()
     self.ladder()
     self.aim.glow()
     self.player.glow(True)
示例#28
0
    def display(self):
        g.screen.fill(self.colors[1])
        if not self.sugar:
            g.screen.fill((255, 255, 192))
            g.screen.blit(g.magician, (g.sx(0), g.sy(18.0)))
        cx = g.sx(26)
        cy = g.sy(5.0)
        utils.centre_blit(g.screen, g.target, (cx, cy))

        if g.aim > 0:
            self.display_n_glow(g.aim, (cx, cy))
        x, y = g.xy1
        pale = False
        if g.state == 2:
            pale = True
        for i in range(len(g.top)):
            x = self.display_n(g.top[i], (x, y), True, False, pale)
            x += g.sp1
        x, y = g.xy3
        for i in range(len(g.buffr)):
            m = g.buffr[i]
            if m == 'plus':
                g.screen.blit(g.plus, (x, y))
                x += g.plus.get_width()
            elif m == 'times':
                g.screen.blit(g.times, (x, y))
                x += g.times.get_width()
            elif m == 'equals':
                g.screen.blit(g.equals, (x, y))
                x += g.equals.get_width()
            else:
                x = self.display_n(g.buffr[i], (x, y))
            x += g.sp2
        if len(g.top) == 0:
            buttons.off(['plus', 'times'])
        buttons.draw()
        if not self.sugar:
            self.slider.draw()
        if g.state == 4:
            utils.centre_blit(g.screen, g.smiley, (g.sx(16), g.sy(12)))
        if g.score > 0:
            self.display_score()
        if not self.sugar and g.best > 0:
            utils.text_blit(
                g.screen, str(g.best), g.font2, g.best_c, utils.ORANGE)
示例#29
0
    def display(self):
        g.screen.fill(self.colors[1])
        if not self.sugar:
            g.screen.fill((255, 255, 192))
            g.screen.blit(g.magician, (g.sx(0), g.sy(18.0)))
        cx = g.sx(26)
        cy = g.sy(5.0)
        utils.centre_blit(g.screen, g.target, (cx, cy))

        if g.aim > 0:
            self.display_n_glow(g.aim, (cx, cy))
        x, y = g.xy1
        pale = False
        if g.state == 2:
            pale = True
        for i in range(len(g.top)):
            x = self.display_n(g.top[i], (x, y), True, False, pale)
            x += g.sp1
        x, y = g.xy3
        for i in range(len(g.buffr)):
            m = g.buffr[i]
            if m == 'plus':
                g.screen.blit(g.plus, (x, y))
                x += g.plus.get_width()
            elif m == 'times':
                g.screen.blit(g.times, (x, y))
                x += g.times.get_width()
            elif m == 'equals':
                g.screen.blit(g.equals, (x, y))
                x += g.equals.get_width()
            else:
                x = self.display_n(g.buffr[i], (x, y))
            x += g.sp2
        if len(g.top) == 0:
            buttons.off(['plus', 'times'])
        buttons.draw()
        if not self.sugar:
            self.slider.draw()
        if g.state == 4:
            utils.centre_blit(g.screen, g.smiley, (g.sx(16), g.sy(12)))
        if g.score > 0:
            self.display_score()
        if not self.sugar and g.best > 0:
            utils.text_blit(g.screen, str(g.best), g.font2, g.best_c,
                            utils.ORANGE)
 def display(self):
     g.screen.fill((255, 255, 192))
     self.st.draw(self.demo)
     if self.demo:
         g.screen.blit(g.mouse_img, (g.sx(6), g.sy(4.5)))
     else:
         if g.best > 1: self.slider.draw()
         if self.smiley:
             utils.centre_blit(g.screen, g.smiley, g.smiley_c)
         if self.sad:
             utils.centre_blit(g.screen, g.sad, g.smiley_c)
         if g.top > 0 and g.level == 8:
             g.screen.blit(g.top_img, g.top_xy1)
             g.screen.blit(g.top_img, g.top_xy2)
             utils.display_number3(\
                 g.screen,g.top,g.top_xy3,g.font2,utils.BLUE)
         if g.circle_c != None:
             utils.centre_blit(g.screen, g.circle_img, g.circle_c)
     buttons.draw()
def display():
    aim.do()
    aim.draw()
    if not aim.running: aim.draw_turtle_abs()
    player.delay = 100 * (6 - g.level)
    player.do()
    player.draw()
    g.screen.blit(g.basic_imgs[g.shape], (g.basic_x, g.basic_y))
    g.screen.blit(g.bgd, (g.sx(0), 0))
    if buttons.active('cyan'):
        g.screen.blit(g.magician, (g.sx(1), g.sy(1.5)))
        utils.centre_blit(g.screen, g.sparkle, (g.sx(4.5), g.sy(3.1)))
    angler.draw()
    s = str(g.repeats[g.repeat])
    c = (g.repeat_cx, g.repeat_cy)
    g.text_rect = utils.text_blit(g.screen, s, g.font2, c, (0, 0, 200))
    s = str(g.aim_n + 1) + ' / ' + str(len(my_turtle.aims))
    utils.text_blit1(g.screen, s, g.font1, (g.sx(6.3), g.sy(8.3)), (0, 0, 255))
    buttons.draw()
    g.slider.draw()
示例#32
0
 def display(self, wait=False):
     if g.state == 1:
         self.menu_display()
         utils.display_number(g.success, (g.sx(.2), g.sy(.15)), g.font2)
     else:
         if self.pj.complete():
             g.screen.blit(g.bgd, (g.sx(0), 0))
             utils.display_number(g.success, (g.sx(.5), g.sy(.5)), g.font1)
         else:
             #                g.screen.fill((g.red,g.green,g.blue))
             g.screen.fill(utils.CYAN)
         self.pj.draw()
         buttons.draw()
         if self.bu2.active:
             if self.pj.all_rotated():
                 self.bu2.off()
             else:
                 utils.centre_blit(g.screen, g.smiley1,
                                   (g.smiley1_x, g.smiley_y))
                 utils.centre_blit(g.screen, g.smiley2,
                                   (g.smiley2_x, g.smiley_y))
示例#33
0
 def display(self):
     g.screen.fill(self.colors[1])
     if self.aim.running or self.aim.glow_active:
         pass
     else:
         x = g.imgs[g.green].x
         y = g.imgs[g.green].y
         w = g.imgs[g.green].w
         h = g.imgs[g.green].h
         # pygame.draw.rect(g.screen, self.colors[0], (x,y,w,h), g.sy(.2))
     for img in g.imgs:  # img from ImgClick (centred)
         img.draw(g.screen)
     if g.wrong:
         img = g.imgs[g.wrong_ind]
         utils.centre_blit(g.screen, g.wrong_img, (img.cx, img.cy))
         img = g.imgs[g.right_ind]
         utils.centre_blit(g.screen, g.glowy[g.right_ind], (img.cx, img.cy))
     if not self.sugar:
         buttons.draw()
         self.slider.draw()
     self.ladder()
     self.aim.glow()
     self.player.glow(True)
示例#34
0
 def display(self):  # called each loop
     if g.big:
         g.screen.fill(self.colors[1])
         utils.centre_blit(g.screen, g.big_surface, (g.sx(16), g.sy(11.5)))
     else:
         if self.sugar:
             g.screen.fill(self.colors[1])
         else:
             g.screen.blit(g.bgd, (g.sx(0), 0))
         g.screen.blit(g.box, (g.x0, g.y0))
         g.screen.blit(g.box, (g.x1, g.y1))
         if not self.sugar:
             utils.centre_blit(g.screen, g.magician, g.magician_c)
         self.draw_goal()
         utils.centre_blit(g.screen, g.turtle,
                           (g.x0 + 4 * g.dd, g.y0 + 6 * g.dd))
         self.tu.draw()
         if self.tu.win:
             utils.centre_blit(g.screen, g.smiley, (g.sx(16.6), g.sy(2.2)))
             if self.sugar:
                 self.cyan_button.set_sensitive(True)
             else:
                 buttons.on('cyan')
             if not self.journal:
                 utils.save()
         self.draw_nos()
         if not self.sugar:
             buttons.draw()
             self.slider.draw()
         if g.score > 0:
             if self.sugar:
                 self.label.set_markup(
                     '<span><big><b> %s</b></big></span>' % (str(g.score)))
             else:
                 utils.display_score()
         utils.display_number1(g.pattern, (g.sx(2.4), g.sy(2)),
                               g.font1, utils.BLUE)
示例#35
0
 def display(self):
     g.screen.fill(self.colors[1])
     self.trip.draw()
     buttons.draw()