コード例 #1
0
ファイル: compound.py プロジェクト: Femtosecond/processing.py
def setup():
    global world, pop, cage
    size(400, 400)
    smooth()
    Fisica.init(this)
    Fisica.setScale(10)
    world = FWorld()
    world.setEdges()
    world.remove(world.top)
    pop = createPop()
    pop.setPosition(width/2, height/2)
    pop.setBullet(True)
    world.add(pop)
    cage = createCage()
    cage.setPosition(width/2, height/2)
    cage.setRotation(PI/6)
    cage.setBullet(True)
    world.add(cage)

    for _ in range(10):
        c = FCircle(7)
        c.setPosition(width/2-10+random(-5, 5), height/2-10+random(-5, 5))
        c.setBullet(True)
        c.setNoStroke()
        c.setFillColor(color(0xFF, 0x92, 0x03))
        world.add(c)

    rectMode(CENTER)
コード例 #2
0
def setup():
    global world, pop, cage
    size(400, 400)
    smooth()
    Fisica.init(this)
    Fisica.setScale(10)
    world = FWorld()
    world.setEdges()
    world.remove(world.top)
    pop = createPop()
    pop.setPosition(width / 2, height / 2)
    pop.setBullet(True)
    world.add(pop)
    cage = createCage()
    cage.setPosition(width / 2, height / 2)
    cage.setRotation(PI / 6)
    cage.setBullet(True)
    world.add(cage)

    for _ in range(10):
        c = FCircle(7)
        c.setPosition(width / 2 - 10 + random(-5, 5),
                      height / 2 - 10 + random(-5, 5))
        c.setBullet(True)
        c.setNoStroke()
        c.setFillColor(color(0xFF, 0x92, 0x03))
        world.add(c)

    rectMode(CENTER)