Code Sketch


Episode 5: Drawing a house-shaped PiggyBank! Colour Gradients - Using gradient to build sky and ground
By: Clinton J. Fernandes
Category: Programming
//CLINTON CODE

clear()
//Background
setBackgroundV(Color(153, 51, 0),Color(153, 249, 255))

setPenColor(brown)          
setSpeed(medium)

right()
forward(100)

//Square 
setFillColor(Color(204, 102, 0))
repeat(4)
{
  right()
forward(200)  
}

//Triangle
setFillColor(Color(102, 0, 0))
repeat(2)
{
  left(120)
forward(200)  
}

left(30)
hop(100)
left()
hop(70)

//windowLeft
setPenColor(black)
repeat(3)
{
  left(120)
forward(35)  
}

repeat(4)
{
  left()
forward(35)  
}

hop(110)




//windowRight
repeat(3)
{
  left(120)
forward(35)  
}

repeat(4)
{
  left()
forward(35)  
}

hop(20)
right()
hop(100)
right()
hop(80)

//Door
right()
forward(80)
left()
forward(50)
left()
forward(80)
right(180)

setPosition(-30,50)

//TopWindow
setFillColor(Color(51, 255, 51))
right()
forward(80)
right()
forward(20)
right()
forward(80)
right()
forward(20)