How to group code? (and move it together)

edited October 2013 in Questions about Code

Hi there,

first of all, I just started coding a few days ago. So I wonder if it's possible to move a figure I've created with shape primitives together as one through the window, which is 800x600 in size. I want to copy it, but don't want to redefine every single position of every single shape. That would be a real pain.

// Pinguin 1
fill(#FFFFFF);
ellipse(430, 470, 20, 30);
ellipse(450, 470, 20, 30);
fill(#626262);
ellipse(440, 445, 45, 65);
fill(#626262);
ellipse(440, 410, 45, 35);
fill(#FFFFFF);
ellipse(440, 410, 40, 30);
fill(#626262);
ellipse(432, 406, 10, 8);
fill(#00D3ED);
ellipse(432, 406, 6, 5);
fill(#626262);
ellipse(448, 406, 10, 8);
fill(#00D3ED);
ellipse(448, 406, 6, 5);
fill(#FFD31F);
triangle(430, 415, 450, 415, 440, 422);
fill(#626262);
ellipse(422, 435, 20, 20);
ellipse(458, 435, 20, 20);
fill(#838383);
ellipse(440, 445, 25, 35);

Best Regards, iSpectra

Tagged:

Answers

Sign In or Register to comment.