#Example Curves
#sprite = codesters.Sprite("curve2_e0b",0,-100)
stage.set_background_color("white")
#(x1, y1) (x2,y2) are the end points
x1 = -100
y1 = 0
x2 = 100
y2 = 25
#(cpx1, cpy1) (cpx2, cpy2) are the center points
cpx1 = -50
cpy1 = 100
cpx2 = 50
cpy2 = 125
sprite = codesters.Curve(x1, y1, cpx1, cpy1, cpx2, cpy2, x2, y2,"lightgreen")
sprite.set_opacity(.5)
sprite2 = codesters.Curve(x1, y1, cpx1, cpy1, cpx2, cpy2, x2, y2,None,"black")
# sprite = codesters.Point(x, y)
ep1 = codesters.Point(x1, y1)
ep1.say("("+str(x1)+","+str(y1)+")")
ep2 = codesters.Point(x2, y2)
ep2.say("("+str(x2)+","+str(y2)+")")
cpp1 =codesters.Point(cpx1,cpy1)
cpp1.say("("+str(cpx1)+","+str(cpy1)+")")
cpp2 =codesters.Point(cpx2, cpy2)
cpp2.say("("+str(cpx2)+","+str(cpy2)+")")
control1 = codesters.Line(x1,y1,cpx1,cpy1,"blue")
control2 = codesters.Line(x2,y2,cpx2,cpy2,"blue")
-
Run Code
-
-
Stop Running Code
-
Show Chart
-
Show Console
-
Codesters How To (opens in a new tab)