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)
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)
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)
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)
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)
def setup(): global boxButton, circleButton, polyButton, world size(400, 400) smooth() Fisica.init(this) world = FWorld() world.setEdges() world.remove(world.left) world.remove(world.right) world.remove(world.top) boxButton = FBox(40, 40) boxButton.setPosition(width/4, 100) boxButton.setStatic(True) boxButton.setFillColor(buttonColor) boxButton.setNoStroke() world.add(boxButton) circleButton = FCircle(40) circleButton.setPosition(2*width/4, 100) circleButton.setStatic(True) circleButton.setFillColor(buttonColor) circleButton.setNoStroke() world.add(circleButton) polyButton = FPoly() polyButton.vertex(20, 20) polyButton.vertex(-20, 20) polyButton.vertex(0, -20) polyButton.setPosition(3*width/4, 100) polyButton.setStatic(True) polyButton.setFillColor(buttonColor) polyButton.setNoStroke() world.add(polyButton)
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)
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)
def setup(): global world size(400, 400) smooth() Fisica.init(this) world = FWorld() world.setEdges() world.remove(world.left) world.remove(world.right) world.remove(world.top) world.setEdgesRestitution(0.0) for i in range(ballCount): b = FCircle(25) b.setPosition(map(i, 0, ballCount - 1, 40, width - 40), height / 6) b.setRestitution(map(i, 0, ballCount - 1, 0.0, 1.0)) b.setNoStroke() b.setFill(map(i, 0, ballCount - 1, 60, 255), 80, 120) world.add(b)
def setup(): global world size(400, 400) smooth() Fisica.init(this) world = FWorld() world.setEdges() world.remove(world.left) world.remove(world.right) world.remove(world.top) world.setEdgesRestitution(0.0) for i in range(ballCount): b = FCircle(25) b.setPosition(map(i, 0, ballCount-1, 40, width-40), height/6) b.setRestitution(map(i, 0, ballCount-1, 0.0, 1.0)) b.setNoStroke() b.setFill(map(i, 0, ballCount-1, 60, 255), 80, 120) world.add(b)