Example #1
0
def main():
    global gb, sides, winner, looser, seconds_left, slowdown, simulatedtime

    place_triangles(0.3)
    b1, b2, b3, b4 = placeBoarders(boarder, wood_dark)
    b1.on_collision(delete_ball)

    place_matchboxes()
    gb = placeBall(gold, 0.19, 0.8,
                   0.05).mass(1.25).on_collision_with(sides, delete_it)
    cb = placeBall(copper, 0.81, 0.7,
                   0.05).mass(.75).on_collision_with(sides, delete_it)
    placeSilos()

    # placeBall (dark_blue, 0.55, 0.4, 0.05).mass (1.5)

    print "before run"
    pge.gravity()
    pge.dump_world()
    pge.draw_collision(True, False)
    pge.slow_down(slowdown)  # slows down real time by a factor of
    pge.register_handler(myquit, [QUIT])
    pge.register_handler(key_pressed, [KEYDOWN])
    pge.register_handler(mouse_hit, [MOUSEBUTTONDOWN])
    pge.display_set_mode([800, 800])
    # pge.display_fullscreen (True)
    seconds_left = simulatedtime * slowdown
    timer()
    pge.run(simulatedtime)
    if not winner:
        looser = True
        pge.text(0.2, 0.3, "Looser", white, 100, 1)
        pge.at_time(4.0, finish_game)
    pge.run(4.0)
    pge.finish()
Example #2
0
def main():
    placeBox([0.4, 0.4], 0.1, red).fix()
    placeBoarders(boarder, wood_dark)
    placeBox([0.47, 0.7], 0.1, blue)
    pge.gravity()
    pge.run(3.0)
    pge.finish()
Example #3
0
def main ():
    placeBox ([0.4, 0.4], 0.1, red).fix ()
    placeBoarders (boarder, wood_dark)
    placeBox ([0.47, 0.7], 0.1, blue)
    pge.gravity ()
    pge.run (3.0)
    pge.finish ()
Example #4
0
def main():
    c = placeBall(0.55, 0.8, 0.1).mass(1).on_collision(callMe)
    l = placeBox([0.3, 0.3], [0.3, 0.5], [0.5, 0.5], [0.5, 0.3])
    b1, b2, b3, b4 = placeBoarders(boarder, wood_dark)
    print("before run")
    pge.gravity()
    pge.dump_world()
    pge.run(3.0)
    pge.finish()
Example #5
0
def main():
    c = placeBall(0.41, 0.89, 0.05).mass(1)
    l = placeTriangle([0.3, 0.3], [0.5, 0.3], [0.4, 0.4])
    b1, b2, b3, b4 = placeBoarders(boarder, wood_dark)
    print("before run")
    pge.gravity()
    pge.dump_world()
    pge.run(3.0)
    pge.finish()
Example #6
0
def main ():
    c = placeBall (0.41, 0.89, 0.05).mass (1)
    l = placeTriangle ([0.3, 0.3], [0.5, 0.3], [0.4, 0.4])
    b1, b2, b3, b4 = placeBoarders (boarder, wood_dark)
    print "before run"
    pge.gravity ()
    pge.dump_world ()
    pge.run (3.0)
    pge.finish ()
Example #7
0
def main ():
    c = pge.circle (0.5, 0.5, 0.3, white, -1)
    l = pge.box (0.0, 0.25, 1.0, 0.02, wood_light, 1)
    b1, b2, b3, b4 = placeBoarders (boarder, wood_dark)
    # b = placeBall (0.5, 0.5, 0.02)
    # b.mass (1.0).on_collision (play_bounce).velocity (0.9, 0.0)
    crate (0.6, 0.6, 0.2)
    print "before run"
    pge.gravity ()
    pge.dump_world ()
    pge.run (10.0)
    pge.finish ()
Example #8
0
def main ():
    
    master = Tk()
  
    master.title("PGE-Sandbox")
    print "About to run window"
    app = wind1(master)
    master.mainloop()
   





    b1, b2, b3, b4 = placeBoarders (boarder, wood_light)
    print "before run"
    pge.gravity ()
    pge.dump_world ()
    pge.run (config.Time)
    pge.finish ()
Example #9
0
def main():
    sb = placeBall(steel, 0.57, 0.8, 0.05).mass(1).on_collision(play_crack)
    cb = placeBall(copper, 0.81, 0.8, 0.05).mass(.75).on_collision(play_bounce)
    gb = placeBall(gold, 0.19, 0.7, 0.05).mass(1.25).on_collision(play_bounce)

    f = placeBall(wood_light, 0.95, 0.05, 0.1).fix()
    # l = placeBox ([0.3, 0.3], [0.3, 0.5], [0.5, 0.5], [0.5, 0.3], white)
    t1 = placeTriangle([0.2, 0.3], [0.4, 0.3], [0.3, 0.4], white)
    t2 = placeTriangle([0.6, 0.3], [0.8, 0.3], [0.7, 0.4], white)
    placeRamps()
    b1, b2, b3, b4 = placeBoarders(boarder, wood_dark)
    for b in [b1, b2, b3, b4]:
        b.on_collision(play_crack)
    box_of(boarder, [0.0, 0.8], 0.2, wood_dark)
    placeSilos()

    print "before run"
    pge.gravity()
    pge.dump_world()
    pge.run(18.0)
    pge.finish()
Example #10
0
def main():
    global g
    # s = placeBall (steel, 0.54, 0.8, 0.05).mass (1).on_collision (play_crack)
    # c = placeBall (copper, 0.85, 0.8, 0.05).mass (.75).on_collision (play_bounce)
    g = placeBall(gold, 0.15, 0.8, 0.05).mass(1.25).on_collision(play_bounce)
    f = placeBall(red, 0.95, 0.05, 0.1).fix()
    l = placeBox([0.3, 0.3], [0.3, 0.5], [0.5, 0.5], [0.5, 0.3])
    b1, b2, b3, b4 = placeBoarders(boarder, wood_dark)
    for b in [b1, b2, b3, b4]:
        b.on_collision(play_crack)

    print "before run"
    pge.gravity()
    pge.dump_world()
    pge.draw_collision(True, False)
    pge.collision_colour(green)
    pge.slow_down(6.0)  # slows down real time by a factor of
    pge.display_set_mode([640, 640])
    pge.register_handler(key_pressed, [KEYDOWN])
    pge.register_handler(mouse_hit, [MOUSEBUTTONDOWN])
    pge.register_handler(myquit, [QUIT])
    pge.run(30.0)
    pge.finish()