// giant chameleon on a branch
var x, y, z;
// ground
for (x = 0; x < 64; x++) {
for (z = 0; z < 96; z++) {
fill(x, 0, z, x, 3, z, 'dirt');
pb(x, 4, z, 'grass_block');
}
}
checkpoint('GROUND');
// the branch: a long log across the build, held by a trunk
fill(28, 18, 4, 35, 21, 92, 'jungle_log');
fill(27, 6, 6, 36, 17, 15, 'jungle_log');
checkpoint('BRANCH');
// body: tall and flat, arched back
var bodyStart = 34;
var bodyEnd = 74;
for (z = bodyStart; z <= bodyEnd; z++) {
var arch = Math.round(6 * Math.sin(Math.PI * (z - bodyStart) / (bodyEnd - bodyStart)));
var top = 30 + arch;
var w = 3;
if (z < bodyStart + 6 || z > bodyEnd - 6) w = 2;
for (x = 32 - w; x <= 32 + w; x++) {
for (y = 22; y <= top; y++) {
pb(x, y, z, 'green_concrete');
}
}
// belly
for (x = 32 - w; x <= 32 + w; x++) {
pb(x, 22, z, 'yellow_terracotta');
pb(x, 23, z, 'yellow_terracotta');
}
// crest
pb(32, top + 1, z, 'green_concrete');
}
checkpoint('BODY');
// legs
for (z = 38; z <= 40; z++) {
fill(28, 19, z, 29, 23, z, 'green_concrete');
fill(35, 19, z, 36, 23, z, 'green_concrete');
}
for (z = 66; z <= 68; z++) {
fill(28, 19, z, 29, 23, z, 'green_concrete');
fill(35, 19, z, 36, 23, z, 'green_concrete');
}
// feet
fill(27, 18, 38, 27, 19, 40, 'lime_terracotta');
fill(37, 18, 38, 37, 19, 40, 'lime_terracotta');
fill(27, 18, 66, 27, 19, 68, 'lime_terracotta');
fill(37, 18, 66, 37, 19, 68, 'lime_terracotta');
checkpoint('LEGS');
// head with a casque
makeSphere(32, 29, 79, 'green_concrete', 5, true);
fill(30, 33, 75, 34, 36, 78, 'green_concrete');
fill(31, 26, 83, 33, 29, 85, 'green_concrete');
// eyes
makeSphere(28, 30, 80, 'lime_terracotta', 2, true);
makeSphere(36, 30, 80, 'lime_terracotta', 2, true);
pb(26, 30, 80, 'black_concrete');
pb(38, 30, 80, 'black_concrete');
// mouth line
fill(30, 26, 85, 34, 26, 85, 'yellow_terracotta');
checkpoint('HEAD');
// tongue and a fly
for (z = 86; z <= 92; z++) {
pb(32, 27, z, 'red_concrete');
}
pb(32, 27, 93, 'pink_concrete');
pb(32, 28, 93, 'cyan_concrete');
checkpoint('TONGUE');
// tail curling back
var tz = 33;
var ty = 24;
var rr;
for (rr = 0; rr < 26; rr++) {
var ang = rr * 0.42;
var cz = Math.round(30 - 8 * Math.cos(ang));
var cy2 = Math.round(26 + 8 * Math.sin(ang));
fill(31, cy2, cz, 33, cy2, cz, 'green_concrete');
}
checkpoint('TAIL');
// a couple of trees and bushes
placeTree(10, 5, 20, 'jungle');
placeTree(52, 5, 60, 'jungle');
placeTree(14, 5, 74, 'jungle');
for (x = 6; x < 60; x = x + 7) {
for (z = 10; z < 90; z = z + 13) {
pb(x, 5, z, 'fern');
}
}
checkpoint('SCENERY');