Code Sketch


Doremon
By: Samiksha Srivastav
Category: Art
def head(x:Int, y:Int){
    setPosition(x, y)
    setPenColor(ColorMaker.hsl(0, 0.00, 0.20))
    setFillColor(ColorMaker.hsl(208, 1.00, 0.50))
    circle(150)
}
def face(x:Int, y:Int){
    setPosition(x, y)
    setFillColor(white)
    circle(120)
}
def eye(x:Int, y:Int){
    setPosition(x, y)
    setPenColor(cm.black)
    setFillColor(white)
    repeat(2) {
        forward(30)
        left(75,30)
        left(15)
        forward(15)
        left(75,25)
        left(15)
    }
}
def pupil(x:Int, y:Int){
    setPosition(x, y)
    setPenColor(noColor)
    setFillColor(black)
    circle(8)
}
def nose(x:Int, y:Int){
    setPosition(x, y)
    setPenColor(black)
    setFillColor(ColorMaker.hsl(0, 0.84, 0.43))
    circle(17)
    setPosition(12, 174)
    setPenColor(noColor)
    setFillColor(white)
    circle(4)
}
def mouth(x:Int, y:Int){
    setPosition(x, y)
    setPenColor(black)
    right(180)
    forward(80)
    savePosHe()
    right()
    right(35,150)
    restorePosHe()
    left()
    left(35,150)
}
def moustach(x:Int, y:Int){
    setPenThickness(1)
    setPosition(x, y)
    savePosHe()
    //right
    forward(40);setPosition(50,142)
    right(32);forward(50);setPosition(50,125)
    right(10);forward(40)
    //left
    setPosition(-50,155);left(158)
    forward(40);setPosition(-50,142)
    left(32);forward(50);setPosition(-50,125)
    left(10);forward(40)
    restorePosHe()
}
def necklace(x:Int, y:Int){
    setPosition(x, y)
    setPenThickness(2)
    right(35)
    setPenColor(black)
    setFillColor(ColorMaker.hsl(0, 0.84, 0.43))
    repeat(2) {
        forward(200)
        right(90,7)
        right(90,7)
    }
    
}
def body(x:Int, y:Int){
    setPosition(x, y)
    setFillColor(ColorMaker.hsl(208, 1.00, 0.50))
    setPenColor(ColorMaker.hsl(0, 0.00, 0.20))
    //left
    right(145)
    forward(80)
    left();forward(45);left();forward(30)
    right(125);forward(150);left();forward(105)
    left();
    repeat(3) {
        right(30,10);right(30,10)
    }
    //right
    left();forward(105);left();forward(150);right(125)
    forward(30);left();forward(45);left();forward(80)
}
def hands(x:Int, y:Int){
    setPosition(x, y)
    setFillColor(white)
    circle(24)
}
def legs(x:Int, y:Int){
    savePosHe()
    right(145)
    setPosition(x, y)
    setFillColor(white)
    repeat(2) {
        forward(100)
        right(90,14)
        right(90,14)
    }
    restorePosHe()
}
def stomach(x:Int, y:Int){
    
    setPosition(x, y)
    left(90)
    repeat(251) {
        forward(1.7);left(360/360)
    }

    left(140);hop(70)
    repeat(172) {
        forward(1.3);right(360/360)
    }
    right(93);forward(148)
}
def locket(x:Int, y:Int){
    setPosition(x, y)
    setFillColor(ColorMaker.hsl(46, 1.00, 0.50))
    circle(20)
    left();forward(13);right()
    setFillColor(black)
    circle(5)
    setPosition(-16,28)
    setFillColor(ColorMaker.hsl(46, 1.00, 0.50))
    repeat(2) {
        forward(31);
        repeat(2) {
            right(90,2)
        }
    }
}
clear()
setSpeed(fast)
setBackgroundH(cm.pink, ColorMaker.hsl(240, 1.00, 0.80))
head(150,150)
face(120,120)
eye(0,200)
pupil(-10, 205)
eye(61,200)
pupil(25, 205)
nose(18,170)
mouth(0,151)
moustach(50,155)
necklace(-100,40)
body(-100,25)
hands(-143,-23)
hands(170,-23)
legs(-114,-190)
legs(14,-190)
stomach(-80,25)
locket(0,-7)
invisible()