I used Transum online logo to create a function that draws a robot. I want to scale the robot by changing the parameters when calling the function but then the arms are detached from the body if I make the robot smaller. Someone suggested I use the tile (~) sign??? but I have no idea how to do this. Any suggestions will be super welcome. Thanks
TO DRAW_RECT :width :height :color
SETPC :color
PD
RT 90
FD :width
RT 90
FD :height
RT 90
FD :width
RT 90
FD :height
RT 90
PU
END
TO ROBOT :size
; Draw body
DRAW_RECT :size :size "blue
; Draw head
PU
BK :size/2
LT 90
FD :size/4
RT 90
PD
DRAW_RECT :size/2 :size/4 "red
; Draw left arm
PU
BK :size/2
LT 90
FD :size/4
LT 90
FD :size/4
RT 90
PD
DRAW_RECT :size/2 :size/4 "green
; Draw right arm
PU
BK :size/2
RT 90
FD :size/4
RT 90
FD :size/4
LT 90
PD
DRAW_RECT :size/2 :size/4 "green
; Draw left leg
PU
BK :size/2
LT 90
FD :size/2
LT 90
FD :size/4
RT 90
PD
DRAW_RECT :size/2 :size/4 "green
; Draw right leg
PU
BK :size/2
RT 90
FD :size/2
RT 90
FD :size/4
LT 90
PD
DRAW_RECT :size/2 :size/4 "green
END
1
TO DRAW_RECT :width :height :color
SETPC :color
PD
RT 90
FD :width
RT 90
FD :height
RT 90
FD :width
RT 90
FD :height
RT 90
PU
END
TO ROBOT :size
; Draw body
DRAW_RECT :size :size "blue
; Draw left arm
PU
BK :size/2
LT 90
PD
DRAW_RECT :size/2 :size/4 "red
; Draw right arm
PU
FD :size*1.5
LT 90
PD
DRAW_RECT :size/2 :size/4 "yellow
; Draw head
PU
BK :size/1.5
LT 180
PD
DRAW_RECT :size/2 :size/4 "purple
; Draw left leg
PU
BK :size
RT 90
FD :size/10
PD
DRAW_RECT :size/2 :size/4 "black
; Draw right leg
PU
RT 90
BK :size/2
RT 180
PD
DRAW_RECT :size/2 :size/4 "green
END
CS
ROBOT 90