g.next_frame(250)

# create box bottom left
box4 = g.create_box(4, 4, -2, g.height - 2)
g.next_frame(250)

# create box bottom right
box5 = g.create_box(4, 4, g.width - 2, g.height - 2)
g.next_frame(250)

# create box outside
box6 = g.create_box(4, 4, -10, -10)
g.next_frame(600)

# remove box outside of frame
g.destroy_box(box6)
g.next_frame(250)

# remove box
g.destroy_box(box5)
g.next_frame(250)

# remove box
g.destroy_box(box4)
g.next_frame(250)

# remove box multiple boxes
g.destroy_box(box3)
g.destroy_box(box2)
g.next_frame(250)
Example #2
0
    #    a=0
    #elif k == Game.SPACE_KEY:
    #print("space key pressed")
    #    g.jump()

    #score_box.set_text("test: %d"% time_elapsed)
#    try:
#        while True:
#            pass
#    except:
#        pass
    k = g.next_frame(delay)  # enter delay in ms
    score_box.set_text("keypress: %d" % k)

    # Check for collisions and end of frames

    for _box in boxes:
        if _box.x + _box.width == 0:
            boxes.remove(_box)
            g.destroy_box(_box)
        if _box.x < 15:
            collision = _box.collision(dino)
            if collision and False:
                g.destroy_box(_box)
                g.quit()
                exit(0)

    # jump

#g.quit(score)