Lesson 3 Code to Animate week 8 Instructions: Choose your editor : You may use p5js 1- the full lesson is here : code to animate 2- In another tab, open: tnis-ict8.blogspot.com 3- Copy the code provided and paste it into the : https://editor.p5js.org/ // Define variables for the airplane's position let x_plane, y_plane; // Define variables for clouds' positions let cloud1_x, cloud1_y, cloud2_x, cloud2_y; function setup() { // Create a canvas and set background color createCanvas(800, 400); background(100, 200, 250); // Light blue sky // Initialize airplane position at the center of the canvas x_plane = width / 2; y_plane = height / 2; // Initialize clouds' positions cloud1_x = random(width); cloud1_y = 0; // Start at the top cloud2_x = random(width); cloud2_y = height / 2; } function draw() { // Clear the can...
Comments
Post a Comment