int canvasWidth = 400; // Width of the canvas
int canvasHeight = 400; // Height of the canvas
int sunX = 100; // X-coordinate of the sun
int sunY = 100; // Y-coordinate of the sun
int sunSize = 80; // Size of the sun
int grassHeight = 100; // Height of the grass
int houseX = 200; // X-coordinate of the house
int houseY = 200; // Y-coordinate of the house
int houseWidth = 150; // Width of the house
int houseHeight = 150; // Height of the house
int roofHeight = 100; // Height of the roof
int doorWidth = 40; // Width of the door
int doorHeight = 100; // Height of the door
int doorX = houseX + houseWidth / 2 - 20; // X-coordinate of the door
int doorY = houseY + houseHeight - doorHeight; // Y-coordinate of the door (adjusted)
// setup function
void settings() {
size(canvasWidth, canvasHeight); // Set the canvas size
}
// setup function
void setup() {
// empty setup function as everything is already initialized
}
// draw function
void draw() {
background(220); // Set the background color
// Sun
fill(255, 255, 0); // Yellow color
ellipse(sunX, sunY, sunSize, sunSize); // Draw the sun
// Grass
fill(0, 255, 0); // Green color
rect(0, canvasHeight - grassHeight, canvasWidth, grassHeight); // Draw the grass
// House
fill(255); // White color
rect(houseX, houseY, houseWidth, houseHeight); // Draw the main body of the house
// Roof
fill(255, 0, 0); // Red color
triangle(houseX - roofHeight / 2, houseY, houseX + houseWidth / 2, houseY - roofHeight, houseX + houseWidth + roofHeight / 2, houseY); // Draw the roof
// Door
fill(150, 75, 0); // Brown color
rect(doorX, doorY, doorWidth, doorHeight); // Draw the door
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}