Ask a shape where it is! ๐
Every shape has an at. It tells VeeLang where to draw the shape.
Now you can ask a shape where it is. Write its name, a dot, and at:
house.at
Before today, this didn't work. VeeLang said it was a mistake. But it wasn't your mistake: it was VeeLang's! Now it's fixed. ๐ ๏ธ
Build a chimney ๐
This house has a chimney. The chimney asks the house where it is, and puts itself on the roof:
Canvas paper having width 400, length 260,
fill "lightskyblue"
draw rectangle house at 120, 120
having width 160, length 120, fill "tomato"
draw rectangle chimney at house.at.x + 110, house.at.y - 40
having width 25, length 40, fill "brown"
draw circle at chimney.at.x + 12, chimney.at.y - 20
having radius 12, fill "white"
draw circle at chimney.at.x + 30, chimney.at.y - 45
having radius 16, fill "white"
house.at.xis how far across the house is.house.at.yis how far down the house is.
So house.at.y - 40 means "40 higher than the house". The smoke does the same thing with the chimney. ๐จ
Try it! ๐ฏ
Press Open in the Playground under the drawing, then:
- ๐ Change the house's
120, 120to40, 100. The chimney and the smoke move with the house, because they ask the house where it is! - ๐ Add a door. Use
house.at.xandhouse.at.yto put it at the bottom of the house. - ๐ Add more smoke, higher and higher.
Have fun! โจ