def update():
    arena.move_all()  # Game logic

    game2d.canvas_fill((255, 255, 255))
    for a in arena.actors():
        x, y, w, h = a.rect()
        # use the following lines to cut a sprite from a larger image
        xs, ys = a.symbol()
        game2d.image_blit(sprites, (x, y), area=(xs, ys, w, h))
Esempio n. 2
0
def update():
    arena.move_all()  # Game logic

    game2d.image_blit(background, (0, 0))
    for a in arena.actors():
        x, y, w, h = a.rect()
        xs, ys = a.symbol()
        if xs >= 0 and ys >= 0:
            game2d.image_blit(sprites, (x, y), area=(xs, ys, w, h))
def update():
    global dx, dy, verso

    game2d.canvas_fill((255, 255, 255))
    game2d.image_blit(image, (dx, dy))

    if dx < screen_x - 150 and dy < screen_y - 150:
        dx = (dx + 20)
        dy = (dy + 60)
    elif dx < screen_x - 150 and dy == screen_y - 150:
        dx = (dx + 20)
def update():
    game2d.image_blit(background, (0, 0),
                      (0, 0, arena.size()[0], arena.size()[1]))
    mario.move()
    """
    x, y, w, h = mario.rect()
    for p in platforms:
        x1, y1, h1, w1 = p.rect()
        if arena.check_collision(mario, p):
            mario.repos_y(y1+h)
            
    if y+h not in platforms[][2]:
        mario.go_down()
    """
    game2d.image_blit(sprites, mario.rect(), mario.symbol())
Esempio n. 5
0
def update():
    global dx,dy,verso

    
    game2d.canvas_fill((255,255,255))
    game2d.image_blit(image, (dx, dy))

    if (0 < dx < screen_x - 160 and x_on != 0) and (0 < dy < screen_y - 160 and y_on != 0):
        dx += 10 * x_on
        dy += 10 * y_on
        print("1^Ciclo Dy: ",dy,"Dx: ",dx)
    elif (dx == 0 or dx == screen_x - 160) and 0 < dy < screen_y - 160:
        dy += 10 * y_on
        print("2^Ciclo Dy: ",dy,"Dx: ",dx)
    elif (dy == 0 or dy == screen_x - 160) and 0 < dx < screen_x - 160:
        dx += 10 * x_on
        print("3^Ciclo Dy: ",dy,"Dx: ",dx)