예제 #1
0
def setup():
    global world

    size(400, 400)
    smooth()
    Fisica.init(this)
    world = FWorld()
    world.setGravity(0, -300)
    l = FPoly()
    l.vertex(width / 2 - hole / 2, 0)
    l.vertex(0, 0)
    l.vertex(0, height)
    l.vertex(0 + sideMargin, height)
    l.vertex(0 + sideMargin, height - bottomMargin)
    l.vertex(width / 2 - hole / 2, topMargin)
    l.setStatic(True)
    l.setFill(0)
    l.setFriction(0)
    world.add(l)
    r = FPoly()
    r.vertex(width / 2 + hole / 2, 0)
    r.vertex(width, 0)
    r.vertex(width, height)
    r.vertex(width - sideMargin, height)
    r.vertex(width - sideMargin, height - bottomMargin)
    r.vertex(width / 2 + hole / 2, topMargin)
    r.setStatic(True)
    r.setFill(0)
    r.setFriction(0)
    world.add(r)
예제 #2
0
def setup():
    global world
    size(400, 400)
    smooth()
    Fisica.init(this)
    world = FWorld()
    world.setGravity(0, 0)
    world.setEdges()
    world.remove(world.left)
    world.remove(world.top)
    world.remove(world.bottom)
    for i in range(ballCount):
        b = FCircle(25)
        b.setPosition(40, map(i, 0, ballCount-1, 40, height-40))
        b.setDensity(map(i, 0, ballCount-1, 0.1, 0.9))
        b.setVelocity(100, 0)
        b.setDamping(0.0)
        b.setNoStroke()
        b.setFill(map(i, 0, ballCount-1, 120, 0))
        world.add(b)
    for i in range(ballCount):
        b = FCircle(25)
        b.setPosition(width/2, map(i, 0, ballCount-1, 40, height-40))
        b.setVelocity(0, 0)
        b.setDamping(0.0)
        b.setDensity(0.9)
        b.setNoStroke()
        b.setFill(125, 80, 120)
        world.add(b)
예제 #3
0
def setup():
    global world

    size(400, 400)
    smooth()
    Fisica.init(this)
    world = FWorld()
    world.setGravity(0, -300)
    l = FPoly()
    l.vertex(width/2-hole/2, 0)
    l.vertex(0, 0)
    l.vertex(0, height)
    l.vertex(0+sideMargin, height)
    l.vertex(0+sideMargin, height-bottomMargin)
    l.vertex(width/2-hole/2, topMargin)
    l.setStatic(True)
    l.setFill(0)
    l.setFriction(0)
    world.add(l)
    r = FPoly()
    r.vertex(width/2+hole/2, 0)
    r.vertex(width, 0)
    r.vertex(width, height)
    r.vertex(width-sideMargin, height)
    r.vertex(width-sideMargin, height-bottomMargin)
    r.vertex(width/2+hole/2, topMargin)
    r.setStatic(True)
    r.setFill(0)
    r.setFriction(0)
    world.add(r)
예제 #4
0
def setup():
    global world
    size(400, 400)
    smooth()
    Fisica.init(this)
    world = FWorld()
    world.setGravity(0, 0)
    world.setEdges()
    world.remove(world.left)
    world.remove(world.top)
    world.remove(world.bottom)
    for i in range(ballCount):
        b = FCircle(25)
        b.setPosition(40, map(i, 0, ballCount - 1, 40, height - 40))
        b.setDensity(map(i, 0, ballCount - 1, 0.1, 0.9))
        b.setVelocity(100, 0)
        b.setDamping(0.0)
        b.setNoStroke()
        b.setFill(map(i, 0, ballCount - 1, 120, 0))
        world.add(b)
    for i in range(ballCount):
        b = FCircle(25)
        b.setPosition(width / 2, map(i, 0, ballCount - 1, 40, height - 40))
        b.setVelocity(0, 0)
        b.setDamping(0.0)
        b.setDensity(0.9)
        b.setNoStroke()
        b.setFill(125, 80, 120)
        world.add(b)
예제 #5
0
def setup():
    global world
    size(400, 400)
    smooth()
    Fisica.init(this)
    world = FWorld()
    world.setGravity(0, 100)
    world.setEdges()
예제 #6
0
def setup():
    global world
    size(400, 400)
    smooth()
    Fisica.init(this)
    world = FWorld()
    world.setEdges()
    world.setGravity(0, 0)
    for _ in range(spiderCount):
        createSpider()
예제 #7
0
def setup():
    global world
    size(400, 400)
    smooth()
    Fisica.init(this)
    world = FWorld()
    world.setEdges()
    world.setGravity(0, 0)
    for _ in range(spiderCount):
        createSpider()
예제 #8
0
def setup():
    global mundo
    size(400, 400)
    smooth()

    Fisica.init(this)
    mundo = FWorld()
    mundo.setGravity(0, 200)

    frameRate(24)
    background(0)
예제 #9
0
def setup():
    global mundo
    size(400, 400)
    smooth()

    Fisica.init(this)
    mundo = FWorld()
    mundo.setGravity(0, 200)

    frameRate(24)
    background(0)
예제 #10
0
def setup():
    global world
    size(400, 400)
    smooth()
    Fisica.init(this)
    world = FWorld()
    world.setGravity(0, 800)
    world.setEdges()
    world.remove(world.left)
    world.remove(world.right)
    world.remove(world.top)

    world.setEdgesRestitution(0.5)
예제 #11
0
def setup():
    global world
    size(400, 400)
    smooth()
    Fisica.init(this)
    world = FWorld()
    world.setGravity(0, 800)
    world.setEdges()
    world.remove(world.left)
    world.remove(world.right)
    world.remove(world.top)

    world.setEdgesRestitution(0.5)
예제 #12
0
def setup():
    global world

    size(400, 400)
    smooth()
    Fisica.init(this)
    font = loadFont("FreeMonoBold-24.vlw")
    textFont(font, 24)
    world = FWorld()
    world.setEdges(this, color(120))
    world.remove(world.top)
    world.setGravity(0, 500)
    t = Texto("Type and ENTER")
    t.setPosition(width / 2, height / 2)
    t.setRotation(random(-1, 1))
    t.setFill(255)
    t.setNoStroke()
    t.setRestitution(0.75)
    world.add(t)
예제 #13
0
def setup():
    global world

    size(400, 400)
    smooth()
    Fisica.init(this)
    font = loadFont("FreeMonoBold-24.vlw")
    textFont(font, 24)
    world = FWorld()
    world.setEdges(this, color(120))
    world.remove(world.top)
    world.setGravity(0, 500)
    t = Texto("Type and ENTER")
    t.setPosition(width/2, height/2)
    t.setRotation(random(-1, 1))
    t.setFill(255)
    t.setNoStroke()
    t.setRestitution(0.75)
    world.add(t)