Code Sketch


rocket
By: Sampada Dhupkar
cleari

showAxes()
showGrid()


def shape3 = Picture{
    right(135)
    forward(70.71)
    right(90)
    forward(70.71)
    right(90)
    forward(70.71)
    right(90)
    forward(70.71)
    right(90)
}.thatsStrokeColored(black)

def shape4 = Picture{
    right()
    forward(100)
    left(135)
    forward(70.71)
    left(90)
    forward(70.71)   
}.thatsStrokeColored(black)

def shape1 = Picture{
    right(135)
    forward(141.42)
    left(135)
    forward(200)
    left(135)
    forward(141.42)
}.thatsStrokeColored(black)

def shape5 = Picture{
    left(45)
    forward(70.71)
    left(135)
    forward(100)
    left(135)
    forward(70.71)
}.thatsStrokeColored(black)

def shape6 = Picture{
    forward(100)
    right(135)
    forward(70.71)
    right(45)
    forward(100)
    right(135)
    forward(70.71)
}.thatsStrokeColored(black)

def shape7 = Picture {
    left(45)
    forward(141.42)
    left(135)
    forward(100)
    left(90)
    forward(100)
}.thatsStrokeColored(black)

def rocket = picStack(
    Picture {},
    shape1.thatsFilledWith(yellow).thatsRotated(90).thatsTranslated(0, 0),
    shape1.thatsFilledWith(orange).thatsRotated(-90).thatsTranslated(100, 100),
    shape3.thatsFilledWith(Color(0, 126, 243)).thatsRotated(90).thatsTranslated(100, 100),
    shape4.thatsFilledWith(blue).thatsRotated(180).withFlippedX.thatsTranslated(150, 150),
    shape5.thatsFilledWith(Color(242, 113, 11)).withFlippedX.thatsRotated(0).thatsTranslated(-150, 50),
    shape6.thatsFilledWith(Color(0, 187, 0)).thatsRotated(90).withFlippedX.thatsTranslated(150,-50),
    shape7.thatsFilledWith(Color(255, 44, 255)).thatsRotated(90).withFlippedX.thatsTranslated(-100, 100)
    
)

rocket.draw