Example #1
0
def format_debug(self, data):
    try:
        d = ''.join(chr(x) for x in data['result'])
    except TypeError as e:
        return
    o = serpent.decode_datalist(d)
    words =  map(lambda x: x-2**256 if x > 2**255 else x, o)
    if words and words[0] == 0xdeba6:
        if len(words) >= 4 + 4 * 16 + 1: # have at least 16 cells
            words = words[1:]
            #msg.data = [cols, rows, a_ai, b_ai] + [a_grid] + [b_grid] + [sorted_redistribution_grid]
            ncells = words[0] * words[1]

            # restore redist
            redist = [0] * ncells
            for i in range(ncells):
                v = words[4 + ncells * 2 + i*2]
                c = words[4 + ncells * 2 + i*2 + 1]
                redist[c] = v
            self.sim_steps += 1

            zeros = [0] * ncells
            # blink grid values
            ui.draw(sim_steps=self.sim_steps, cols=words[0], rows=words[1], a_grid=zeros,
                b_grid=zeros, redistribution_grid=redist)
            time.sleep(.2)
            ui.draw(sim_steps=self.sim_steps, cols=words[0], rows=words[1], a_grid=words[4:4+ncells],
                b_grid=words[4+ncells:4+ncells*2], redistribution_grid=redist)
Example #2
0
def draw(frame_time):
    global button, button2
    clear_canvas()
    background.draw()
    boy.draw()
    #button.draw()
    #button2.draw()
    ui.draw()
    update_canvas()
Example #3
0
def draw():
    clear_canvas()
    game_world.draw()
    ui.draw()

    global player
    life.draw(player.life)

    global gameState, gameOverImage
    if gameState == GAMESTETE_GAMEOVER:
        gameOverImage.draw(get_canvas_width() / 2, get_canvas_height() / 2)
        highscore.draw()

    update_canvas()
    def draw(self):
        ui.draw()
        self.coin.draw()
        self.slot_imgs[self.slot[0]].draw(200, 500)
        self.slot_imgs[self.slot[1]].draw(400, 500)
        self.slot_imgs[self.slot[2]].draw(600, 500)
        if self.slot[0] not in player_info['have']:
            self.lock.draw(200, 500)
        if self.slot[1] not in player_info['have']:
            self.lock.draw(400, 500)
        if self.slot[2] not in player_info['have']:
            self.lock.draw(600, 500)

        img = self.slot_imgs[self.slot[self.select]]
        img.clip_draw(0, 0, img.w, img.h, 150, 300, 200, 200)
Example #5
0
def draw():
    clear_canvas()
    game_world.draw()
    ui.draw()

    global brick
    brick.draw()

    global player
    life.draw(player.life)

    global wall
    wall.drawRight()

    # global gameState, gameOverImage
    # if gameState == GAMESTETE_GAMEOVER:
    #     gameOverImage.draw(get_canvas_width() / 2, get_canvas_height() / 2)
    #     highscore.draw()

    update_canvas()
Example #6
0
def format_debug(self, data):
    try:
        d = ''.join(chr(x) for x in data['result'])
    except TypeError as e:
        return
    o = serpent.decode_datalist(d)
    words = map(lambda x: x - 2**256 if x > 2**255 else x, o)
    if words and words[0] == 0xdeba6:
        if len(words) >= 4 + 4 * 16 + 1:  # have at least 16 cells
            words = words[1:]
            #msg.data = [cols, rows, a_ai, b_ai] + [a_grid] + [b_grid] + [sorted_redistribution_grid]
            ncells = words[0] * words[1]

            # restore redist
            redist = [0] * ncells
            for i in range(ncells):
                v = words[4 + ncells * 2 + i * 2]
                c = words[4 + ncells * 2 + i * 2 + 1]
                redist[c] = v
            self.sim_steps += 1

            zeros = [0] * ncells
            # blink grid values
            ui.draw(sim_steps=self.sim_steps,
                    cols=words[0],
                    rows=words[1],
                    a_grid=zeros,
                    b_grid=zeros,
                    redistribution_grid=redist)
            time.sleep(.2)
            ui.draw(sim_steps=self.sim_steps,
                    cols=words[0],
                    rows=words[1],
                    a_grid=words[4:4 + ncells],
                    b_grid=words[4 + ncells:4 + ncells * 2],
                    redistribution_grid=redist)
Example #7
0
def uiDraw():
    global pan
    pan.draw()
    ui.draw()

    pass
Example #8
0
 def draw(self):
     self.image.draw(400, 300)
     ui.draw()
Example #9
0
def draw():
    clear_canvas()
    ui.draw()
    update_canvas()
Example #10
0
 def draw(self):
     ui.draw()
     self.coin.draw()
Example #11
0
File: main.py Project: kovrov/scrap
def on_draw():
    win.clear()
    scene.draw()
    ui.draw(win.width, win.height)
 def draw(self):
     ui.draw()