Code Sketch


Boat Sailing
By: Vinod Naik
Category: Art
cleari


//code for different shapes
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 shape8  = Picture {
        hop(140)
        setPenColor(Color(247, 253, 249))
        setPenThickness(3)
        circle(30)
     }
     
//code for lineargradient background 

def newColor = cm.deepSkyBlue
setBackground(cm.linearGradient(
    0, -10, cm.aquamarine, 0,170, newColor))


//code for boat

def tangram = picStack(
    Picture{},
    shape6.thatsRotated(45).thatsTranslated(-250, -200).thatsFilledWith(cm.darkGreen),
    shape4.thatsRotated(-45).thatsTranslated(-250, -129).thatsFilledWith(cm.green),
    shape7.thatsRotated(-90).thatsTranslated(-179, -200).thatsFilledWith(cm.red),
    shape1.thatsRotated(90).withFlippedY.thatsTranslated(-80, -100).thatsFilledWith(cm.orange),
    shape1.thatsRotated(90).thatsTranslated(20, -200).thatsFilledWith(cm.darkGray),
    shape4.thatsTranslated(-180, -100).thatsFilledWith(cm.green),
    shape3.thatsTranslated(-130, 50).thatsFilledWith(cm.dodgerBlue)
    )

tangram.draw
shape8.thatsFilledWith(Color(255, 238, 22))
.thatsTranslated(290, 40).withFading(60).draw