def draw(self):
        scene.background(0, 0.5, 1.0)
        scene.fill(1, 1, 1)
        scene.rect(self.x,self.y, 32, 32)  # player
        scene.fill(0, 0, 0)
        scene.rect(self.x - 70, self.y + 75, 700, 32)  # roof
        self.floor = scene.rect(self.x - 70, self.y - 75, 700, 32)  # floor
        print('self.floor is always None:', self.floor)
        if not self.grav:
            self.acel += 1

  #text
        scene.tint(0, 0, 0, 1)
        if self.dead:
            scene.text('You are DEAD', 'Arial', 12, 48, self.y + 16)
        else:
            self.pts += 1
        scene.text('Points: %i' % self.pts, 'Arial', 12, self.x-48, self.y + 32)

  # Touch input:
        scene.fill(1,0,0)
        if not self.grav:
            self.acel += 1

  # Physics
        if not self.dead:
            self.y += self.acel
        if self.y < self.floor:
            self.y = self.floor
            self.acel = 0
        else:
            print('problem: {} > {}'.format(self.y, self.floor))
            self.acel -= self.g
        self.acel = max(min(self.acel, self.ms), -self.ms)
 def draw(self):
     x,y,z = motion.get_attitude() if use_motion else scene.gravity()
     r,g,b = abs(x), abs(y), abs(z)
     scene.background(r, g, b)
     super(Advice, self).draw()
     scene.tint(1-r, 1-g, 1-b)
     scene.text(self.answer, 'Futura', 45, *self.center)
Example #3
0
 def draw(self):
     x,y,z = motion.get_attitude() if use_motion else scene.gravity()
     r,g,b = abs(x), abs(y), abs(z)  # No negative colors
     scene.background(r, g, b)
     scene.tint(1-r, 1-g, 1-b)
     scene.text(fmt.format(x, y, z), font_size=32,
                x=self.center.x, y=self.center.y)
 def draw(self):
     scene.background(bg_color.r, bg_color.g, bg_color.b)
     fg_color = inverse_color(bg_color)
     scene.tint(*fg_color) # .r, fg_color.g, fg_color.b)
     the_text = fmt.format(*bg_color)
     if local_ip_addr:  # if remote user has not yet connected
         the_text += '\n\n' + ip_fmt.format(local_ip_addr)
     scene.text(the_text, font_size=40, x=self.x, y=self.y)
Example #5
0
 def draw(self):
     self.root_layer.update(self.dt)
     self.root_layer.draw()
     scene.tint(*self.current_color())  # draw the user's text
     scene.text(self.text, self.current_font(), self.fontsize,
                self.position[0], self.position[1], 5)
     scene.fill(*color('white'))   # watch+battery -> white background
     scene.rect(0, 748, 1024, 20)  # watch+battery
 def draw(self):
     scene.background(bg_color.r, bg_color.g, bg_color.b)
     fg_color = inverse_color(bg_color)
     scene.tint(*fg_color)  # .r, fg_color.g, fg_color.b)
     the_text = fmt.format(*bg_color)
     if local_ip_addr:  # if remote user has not yet connected
         the_text += '\n\n' + ip_fmt.format(local_ip_addr)
     scene.text(the_text, font_size=40, x=self.x, y=self.y)
Example #7
0
 def draw(self):
     scene.background(*color('black'))
     self.root_layer.update(self.dt)
     self.root_layer.draw()
     scene.tint(*self.current_color())  # draw the user's text
     scene.text(self.text, self.current_font(), self.fontsize,
                self.position[0], self.position[1]+self.btn_height, 5)   # add ...position[1]+self.btn_height
     scene.fill(*color('white'))   # watch+battery -> white background
     scene.rect(0, self.bounds.h, self.bounds.w, 20)  # watch+battery
Example #8
0
 def draw(self):
     scene.background(*color('black'))
     self.root_layer.update(self.dt)
     self.root_layer.draw()
     scene.tint(*self.current_color())  # draw the user's text
     scene.text(self.text, self.current_font(), self.fontsize,
                self.position[0], self.position[1] + self.btn_height,
                5)  # add ...position[1]+self.btn_height
     scene.fill(*color('white'))  # watch+battery -> white background
     scene.rect(0, self.bounds.h, self.bounds.w, 20)  # watch+battery
Example #9
0
 def draw(self):
     scene.background(0, 0, 0)
     scene.fill(1, 1, 1)
     x = screen_width / 2
     s_y = screen_height / 2 + 100
     d_y = s_y - 30
     l_y = d_y - 75
     scene.tint(0.32645,0.28306,0.93492)
     scene.text('PhantomChess version {}'.format(version), x=x, y=s_y, font_size=20.0)
     scene.tint(1, 1, 1)
     if debug:
         scene.text('Debugger set to level {}'.format(debug), x=x, y=d_y)
     for i, line in enumerate(short().splitlines()):
         scene.text(line, x=x, y=l_y - (i*20))
Example #10
0
 def draw(self):
     scene.background(0, 0, 0)
     scene.fill(1, 1, 1)
     x, y = self.bounds.center()
     #print(self.bounds)
     s_y = y + 100
     d_y = s_y - 30
     l_y = s_y - 75
     scene.tint(0.32645, 0.28306, 0.93492)
     scene.text('PhantomChess version {}'.format(C.version), x=x, y=s_y, font_size=20.0)
     scene.tint(1, 1, 1)
     if C.debug:
         scene.text('Debugger set to level {}'.format(C.debug), x=x, y=d_y)
     for i, line in enumerate(short().splitlines()):
         scene.text(line, x=x, y=l_y - (i*20))
Example #11
0
	def draw(self):
		x,y,z = motion.get_attitude() if use_motion else scene.gravity()
		r,g,b = abs(x), abs(y), abs(z)
		scene.background(r, g, b)
		scene.tint(1-r, 1-g, 1-b)
		scene.text(answer.format(x, y, z), font_size=45, x=self.center.x, y=self.center.y)
		for p in self.particles:
			p.update()
			p.draw()
		for t in self.touches.values():
			for p in self.particles:
				tx, ty = t.location.x, t.location.y
				d = (p.x - tx)*(p.x - tx)+(p.y - ty)*(p.y - ty)
				d = sqrt(d)
				p.vx = p.vx - 5/d*(p.x-tx)
				p.vy = p.vy - 5/d*(p.y-ty)
				p.colour = Color(random.random(), random.random(), random.random())
Example #12
0
 def draw(self):
     scene.background(0, 0, 0)
     scene.fill(1, 1, 1)
     x, y = self.bounds.center()
     #print(self.bounds)
     s_y = y + 100
     d_y = s_y - 30
     l_y = s_y - 75
     scene.tint(0.32645, 0.28306, 0.93492)
     scene.text('PhantomChess version {}'.format(C.version),
                x=x,
                y=s_y,
                font_size=20.0)
     scene.tint(1, 1, 1)
     if C.debug:
         scene.text('Debugger set to level {}'.format(C.debug), x=x, y=d_y)
     for i, line in enumerate(short().splitlines()):
         scene.text(line, x=x, y=l_y - (i * 20))
Example #13
0
 def draw(self):
     x, y, z = motion.get_attitude() if use_motion else scene.gravity()
     r, g, b = abs(x), abs(y), abs(z)
     scene.background(r, g, b)
     scene.tint(1 - r, 1 - g, 1 - b)
     scene.text(answer.format(x, y, z),
                font_size=45,
                x=self.center.x,
                y=self.center.y)
     for p in self.particles:
         p.update()
         p.draw()
     for t in self.touches.values():
         for p in self.particles:
             tx, ty = t.location.x, t.location.y
             d = (p.x - tx) * (p.x - tx) + (p.y - ty) * (p.y - ty)
             d = sqrt(d)
             p.vx = p.vx - 5 / d * (p.x - tx)
             p.vy = p.vy - 5 / d * (p.y - ty)
             p.colour = Color(random.random(), random.random(),
                              random.random())
Example #14
0
	def draw(self):
		self.prevmode = self.mode
		self.mode = 'off'
		for touch in touches:
			if touch.location in scene.Rect(*self.rect):
				self.mode = 'on'
			elif self.prevmode == 'on':
				self.mode = 'up'
				
		if self.mode == 'on':
			scene.fill(*self.altcolor)
			scene.tint(*self.alttxtcolor)
			scene.stroke(*self.altbordrcolor)
		else:
			scene.fill(*self.color)
			scene.tint(*self.txtcolor)
			scene.stroke(*self.bordrcolor)
		
		scene.stroke_weight(self.bordrw)
		scene.rect(*self.rect)
		scene.text(self.text, self.font, self.fontsize, self.rect[0] + self.rect[2] / 2, self.rect[1] + self.rect[3] / 2)
Example #15
0
    def draw(self):
        portrait = self.size.h > self.size.w
        scene.background(0.40, 0.80, 1.00) # light blue background color

        if portrait:
            self.play_btn_rect = scene.Rect(200, 358, 600, 100)
            self.char_btn_rect = scene.Rect(140, 485, 470, 100)
        else:
            self.play_btn_rect = scene.Rect( 20, 358, 350, 100)
            self.char_btn_rect = scene.Rect( 20, 485, 230, 100)
        
        scene.fill(0.50, 1.00, 0.00) # play button fill color
        scene.rect(*self.play_btn_rect)
        scene.fill(1.00, 1.00, 1.00) # character select button fill color
        scene.rect(*self.char_btn_rect)
        
        scene.tint(1.00, 1.00, 1.00) # white text color
        fs, x, y = (100, 385, 850) if portrait else (150, 525, 600)
        scene.text('Cloud Jump', MENU_FONT,  font_size=fs, x=x, y=y)
        fs, x, y = ( 65, 380, 650) if portrait else ( 65, 200, 400)
        scene.text('Play Game', BUTTON_FONT, font_size=fs, x=x, y=y)
        scene.tint(0.00, 0.50, 1.00) # blue text color
        fs, x, y = ( 54, 380, 521) if portrait else ( 54, 260, 285)
        scene.text('Character Select', BUTTON_FONT, font_size=fs, x=x, y=y)
        scene.tint(1.00, 1.00, 1.00) # white text color
        fs =  30
        if portrait:
            x, y = self.bounds.w / 2.0, self.bounds.h / 1.34
        else:
            x, y = self.bounds.w / 1.4, self.bounds.h / 1.7
        s = 'Welcome {}!'.format(player_name)
        scene.text(s, MENU_FONT, font_size=fs, x=x, y=y)

        for i in xrange(11):
            scene.image('PC_Grass_Block', self.bounds.w / 11 * i, 0)
Example #16
0
    def draw(self):
        self.prevmode = self.mode
        self.mode = 'off'
        for touch in touches:
            if touch.location in scene.Rect(*self.rect):
                self.mode = 'on'
            elif self.prevmode == 'on':
                self.mode = 'up'

        if self.mode == 'on':
            scene.fill(*self.altcolor)
            scene.tint(*self.alttxtcolor)
            scene.stroke(*self.altbordrcolor)
        else:
            scene.fill(*self.color)
            scene.tint(*self.txtcolor)
            scene.stroke(*self.bordrcolor)

        scene.stroke_weight(self.bordrw)
        scene.rect(*self.rect)
        scene.text(self.text, self.font, self.fontsize,
                   self.rect[0] + self.rect[2] / 2,
                   self.rect[1] + self.rect[3] / 2)
Example #17
0
    def draw(self):
        scale_factor = self.square_size
        scene.background(0, 0, 0)
        scene.fill(1, 1, 1, 1)
        board = self.game_view.game.board
        if self.render_mode['pieces']:
            for piece in board.pieces:
                scene.tint(1, 1, 1, 0.5)
                pos = self.as_screen(piece)  # piece.coord.as_screen
                #print(self.img_names)
                img = self.img_names[piece.name]
                scene.image(img, pos.x, pos.y, scale_factor, scale_factor)
                scene.tint(1, 1, 1, 1)
                if piece.fen_loc == self.selected:
                    scene.fill(0.23347, 0.3564, 0.59917, 0.6)
                    scene.rect(pos.x, pos.y, scale_factor, scale_factor)
                    scene.fill(1, 1, 1, 1)
            if self.render_mode['timers']:
                white = str(board.player1.timer.get_run())
                black = str(board.player2.timer.get_run())
                bpos = Coord(992, 672)
                wpos = Coord(992, 96)
                scene.tint(1, 1, 1, 1)
                scene.text(black, x=bpos.x, y=bpos.y)
                scene.text(white, x=wpos.x, y=wpos.y)
                scene.tint(1, 1, 1, 1)
        if self.render_mode['sqrs']:
            for tile in board.tiles:
                x = int(tile.color == 'white')  # zero or one Thi is code
                color = (x, x, x, 0.57)  # alpha value
                scene.fill(*color)
                pos = self.as_screen(tile)  # tile.as_screen
                scene.rect(pos.x, pos.y, scale_factor, scale_factor)
                scene.fill(1, 1, 1, 1)
                if self.render_mode['coords']:
                    center = Coord(pos.x + (scale_factor / 2),
                                   pos.y + (scale_factor / 2))
                    chess_pos = center + Coord(0, 10)
                    coord_pos = center - Coord(0, 10)
                    chess = tile.coord.as_chess
                    coord = str(tile.coord.as_tup)
                    scene.text(chess, x=chess_pos.x, y=chess_pos.y)
                    scene.text(coord, x=coord_pos.x, y=coord_pos.y)
            #if self.err_pos:  # FIXME this needs to be reenabled!
            #    sc = self.err_pos.as_screen
            #    scene.fill(1, 0, 0, 0.3)
            #    scene.rect(sc.x, sc.y, scale_factor, scale_factor)
            #    scene.fill(1, 1, 1, 1)
            #    scene.tint(0, 0, 1, 1)
            #    scene.text('Move\nInvalid', x=(sc.x + scale_factor/2), y=(sc.y + scale_factor/2))
            #    scene.tint(1, 1, 1, 1)
        if self.render_mode['valid']:
            for tile in board.tiles:
                #if self.valid_cache:
                #    print([x for x in self.valid_cache])
                #if tile.coord in self.valid_cache:  # FIXME
                if tile.fen_loc in self.valid_cache:
                    pos = self.as_screen(tile)  # tile.coord.as_screen
                    scene.fill(0.47934, 0.81198, 0.41839, 0.3)
                    scene.rect(pos.x, pos.y, scale_factor, scale_factor)
                    scene.fill(1, 1, 1, 1)
        if self.render_mode['turn_color']:
            if board.turn == 'white':
                turn_y = 1 * scale_factor
            elif board.turn == 'black':
                turn_y = 7 * scale_factor
            pos = Coord(896, turn_y)
            size = Coord(scale_factor / 2, scale_factor / 2)
            scene.tint(1, 1, 1, 1)
            scene.image(self.turn_indicator_img, pos.x, pos.y, size.x, size.y)
            scene.tint(1, 1, 1, 1)
        if self.won:
            pos = Coord(self.size.w / 2, self.size.h / 2)
            scene.tint(0.32645, 0.28306, 0.93492)
            # commented out until the bug in ChessGame.is_won() is fixed to be
            # less annoying
            scene.text('{} wins'.format(self.won),
                       x=pos.x,
                       y=pos.y,
                       font_size=40.0)
            scene.tint(1, 1, 1, 1)

        # Buttons
        x = scale_factor / 2
        scene.text('AI Easy', x=x, y=scale_factor * 6 - x)
        scene.text('AI Hard', x=x, y=scale_factor * 5 - x)
        scene.text('Get score', x=x, y=scale_factor * 4 - x)
        if self.disp_score:
            scene.text(str(self.pos_score),
                       x=x,
                       y=scale_factor * 4 - scale_factor / 1.5)
        scene.text('Undo', x=x, y=scale_factor * 3 - x)
        scene.text('Deselect', x=x, y=scale_factor * 2 - x)
        scene.text('Options', x=x, y=scale_factor * 7 - x)
Example #18
0
def tinted_text(s, x, y, tint_color=Color(0, 0, 1, 0)):
    tint(0, 0, 0)
    text(s, GAME_FONT, 48, x + 2, y - 2)
    tint(*tint_color)
    text(s, GAME_FONT, 48, x, y)
Example #19
0
def tinted_text(s, x, y, tint_color = scene.Color(0, 0, 1)):
    scene.tint(0, 0, 0)
    scene.text(s, GAME_FONT, 48, x + 2, y - 2)
    scene.tint(*tint_color)
    scene.text(s, GAME_FONT, 48, x, y)
Example #20
0
 def draw(self):
     scene.background(0, 0, 0)
     scene.fill(1, 1, 1, 1)
     if self.render_mode['pieces']:
         for piece in self.game.board.pieces:
             scene.tint(1, 1, 1, 0.5)
             pos = piece.coord.as_screen()
             img = self.img_names[piece.pythonista_gui_imgname]
             scene.image(img, pos.x, pos.y, scale_factor, scale_factor)
             scene.tint(1, 1, 1, 1)
             if piece.coord == self.selected:
                 scene.fill(0.23347,0.3564,0.59917, 0.6)
                 scene.rect(pos.x, pos.y, scale_factor, scale_factor)
                 scene.fill(1, 1, 1, 1)
         if self.render_mode['timers']:
             white = str(self.game.board.player1.timer.get_run())
             black = str(self.game.board.player2.timer.get_run())
             bpos = Coord(992, 672)
             wpos = Coord(992, 96)
             scene.tint(1, 1, 1, 1)
             scene.text(black, x=bpos.x, y=bpos.y)
             scene.text(white, x=wpos.x, y=wpos.y)
             scene.tint(1, 1, 1, 1)
     if self.render_mode['sqrs']:
         for tile in self.game.board.tiles:
             color = tile.color.tilecolor
             color += (0.57,)  # alpha value
             pos = tile.coord.as_screen()
             scene.fill(*color)
             scene.rect(pos.x, pos.y, scale_factor, scale_factor)
             scene.fill(1, 1, 1, 1)
             if self.render_mode['coords']:
                 center = Coord(pos.x + (scale_factor / 2), pos.y + (scale_factor / 2))
                 chess_pos = center + Coord(0, 10)
                 coord_pos = center - Coord(0, 10)
                 chess = tile.coord.as_chess()
                 coord = str(tile.coord.as_tup())
                 scene.text(chess, x=chess_pos.x, y=chess_pos.y)
                 scene.text(coord, x=coord_pos.x, y=coord_pos.y)
         if self.err_pos.x is not None:
             sc = self.err_pos.as_screen()
             scene.fill(1, 0, 0, 0.3)
             scene.rect(sc.x, sc.y, scale_factor, scale_factor)
             scene.fill(1, 1, 1, 1)
             scene.tint(0, 0, 1, 1)
             scene.text('Move\nInvalid', x=(sc.x + scale_factor/2), y=(sc.y + scale_factor/2))
             scene.tint(1, 1, 1, 1)
     if self.render_mode['valid']:
         for tile in self.game.board.tiles:
             if tile.coord in self.valid_cache:
                 pos = tile.coord.as_screen()
                 scene.fill(0.47934,0.81198,0.41839, 0.3)
                 scene.rect(pos.x, pos.y, scale_factor, scale_factor)
                 scene.fill(1, 1, 1, 1) 
     if self.render_mode['turn']:
         if self.game.board.turn == 'white':
             turn_y = 1 * scale_factor
         elif self.game.board.turn == 'black':
             turn_y = 7 * scale_factor
         pos = Coord(896, turn_y)
         size = Coord(scale_factor / 2, scale_factor / 2)
         scene.tint(1, 1, 1, 1)
         scene.image(self.turn_indicator_img, pos.x, pos.y, size.x, size.y)
         scene.tint(1, 1, 1, 1)
     if self.won:
         pos = Coord(self.size.w/2, self.size.h/2)
         scene.tint(0.32645,0.28306,0.93492)
         # commented out until the bug in ChessGame.is_won() is fixed to be 
         # less annoying
         scene.text('{} wins'.format(self.won), x=pos.x, y=pos.y, font_size=40.0)
         scene.tint(1, 1, 1, 1)
     
     # Buttons
     scene.text('AI Easy', x=scale_factor/2, y=scale_factor*6 - scale_factor/2)
     scene.text('AI Hard', x=scale_factor/2, y=scale_factor*5 - scale_factor/2)
     scene.text('Get score', x=scale_factor/2, y=scale_factor*4 - scale_factor/2)
     if self.disp_score:
         scene.text(str(self.pos_score), x=scale_factor/2, y=scale_factor*4 - scale_factor/1.5)
     scene.text('Undo', x=scale_factor/2, y=scale_factor*3 - scale_factor/2)
     scene.text('Deselect', x=scale_factor/2, y=scale_factor*2 - scale_factor/2)
     scene.text('Options', x=scale_factor/2, y=scale_factor*7 - scale_factor/2)
def tinted_text(s, x, y, tint_color = scene.Color(0, 0, 1)):
    font_name = 'AppleSDGothicNeo-Bold'
    scene.tint(0, 0, 0)
    scene.text(s, font_name, 48, x + 2, y - 2)
    scene.tint(*tint_color)
    scene.text(s, font_name, 48, x, y)
Example #22
0
def tinted_text(s, x, y, tint_color=Color(0, 0, 1, 0)):
    tint(0, 0, 0)
    text(s, GAME_FONT, 48, x + 2, y - 2)
    tint(*tint_color)
    text(s, GAME_FONT, 48, x, y)
    def draw(self):
        scale_factor = self.square_size
        scene.background(0, 0, 0)
        scene.fill(1, 1, 1, 1)
        board = self.game_view.game.board
        if self.render_mode['pieces']:
            for piece in board.pieces:
                scene.tint(1, 1, 1, 0.5)
                pos = self.as_screen(piece)  # piece.coord.as_screen
                #print(self.img_names)
                img = self.img_names[piece.name]
                scene.image(img, pos.x, pos.y, scale_factor, scale_factor)
                scene.tint(1, 1, 1, 1)
                if piece.fen_loc == self.selected:
                    scene.fill(0.23347,0.3564,0.59917, 0.6)
                    scene.rect(pos.x, pos.y, scale_factor, scale_factor)
                    scene.fill(1, 1, 1, 1)
            if self.render_mode['timers']:
                white = str(board.player1.timer.get_run())
                black = str(board.player2.timer.get_run())
                bpos = Coord(992, 672)
                wpos = Coord(992, 96)
                scene.tint(1, 1, 1, 1)
                scene.text(black, x=bpos.x, y=bpos.y)
                scene.text(white, x=wpos.x, y=wpos.y)
                scene.tint(1, 1, 1, 1)
        if self.render_mode['sqrs']:
            for tile in board.tiles:
                x = int(tile.color == 'white')  # zero or one Thi is code
                color = (x, x, x, 0.57)  # alpha value
                scene.fill(*color)
                pos = self.as_screen(tile)  # tile.as_screen
                scene.rect(pos.x, pos.y, scale_factor, scale_factor)
                scene.fill(1, 1, 1, 1)
                if self.render_mode['coords']:
                    center = Coord(pos.x + (scale_factor / 2), pos.y + (scale_factor / 2))
                    chess_pos = center + Coord(0, 10)
                    coord_pos = center - Coord(0, 10)
                    chess = tile.coord.as_chess
                    coord = str(tile.coord.as_tup)
                    scene.text(chess, x=chess_pos.x, y=chess_pos.y)
                    scene.text(coord, x=coord_pos.x, y=coord_pos.y)
            #if self.err_pos:  # FIXME this needs to be reenabled!
            #    sc = self.err_pos.as_screen
            #    scene.fill(1, 0, 0, 0.3)
            #    scene.rect(sc.x, sc.y, scale_factor, scale_factor)
            #    scene.fill(1, 1, 1, 1)
            #    scene.tint(0, 0, 1, 1)
            #    scene.text('Move\nInvalid', x=(sc.x + scale_factor/2), y=(sc.y + scale_factor/2))
            #    scene.tint(1, 1, 1, 1)
        if self.render_mode['valid']:
            for tile in board.tiles:
                #if self.valid_cache:
                #    print([x for x in self.valid_cache])
                #if tile.coord in self.valid_cache:  # FIXME
                if tile.fen_loc in self.valid_cache:
                    pos = self.as_screen(tile)  # tile.coord.as_screen
                    scene.fill(0.47934,0.81198,0.41839, 0.3)
                    scene.rect(pos.x, pos.y, scale_factor, scale_factor)
                    scene.fill(1, 1, 1, 1)
        if self.render_mode['turn_color']:
            if board.turn == 'white':
                turn_y = 1 * scale_factor
            elif board.turn == 'black':
                turn_y = 7 * scale_factor
            pos = Coord(896, turn_y)
            size = Coord(scale_factor / 2, scale_factor / 2)
            scene.tint(1, 1, 1, 1)
            scene.image(self.turn_indicator_img, pos.x, pos.y, size.x, size.y)
            scene.tint(1, 1, 1, 1)
        if self.won:
            pos = Coord(self.size.w/2, self.size.h/2)
            scene.tint(0.32645,0.28306,0.93492)
            # commented out until the bug in ChessGame.is_won() is fixed to be
            # less annoying
            scene.text('{} wins'.format(self.won), x=pos.x, y=pos.y, font_size=40.0)
            scene.tint(1, 1, 1, 1)

        # Buttons
        x=scale_factor/2
        scene.text('AI Easy', x=x, y=scale_factor*6 - x)
        scene.text('AI Hard', x=x, y=scale_factor*5 - x)
        scene.text('Get score', x=x, y=scale_factor*4 - x)
        if self.disp_score:
            scene.text(str(self.pos_score), x=x, y=scale_factor*4 - scale_factor/1.5)
        scene.text('Undo', x=x, y=scale_factor*3 - x)
        scene.text('Deselect', x=x, y=scale_factor*2 - x)
        scene.text('Options', x=x, y=scale_factor*7 - x)
Example #24
0
 def draw(self):
     #scene.background(*color('black'))
     self.root_layer.update(self.dt)
     self.root_layer.draw()
     scene.tint(*self.current_color())  # draw the user's text
     scene.text(self.text, self.current_font(), self.fontsize, self.textPosition[0], self.textPosition[1], 5)