This exercise is a project from Khan Academy’s Intro to JS: Drawing & Animation.
The objective of this exercise is to write a program below to make a star shoot across the screen. The animated video could not be uploaded to the blog.
var xPos = 10;
var yPos = 10;
var xPos2 = 20;
var yPos2 = 20;
draw = function() {
background(20, 19, 19);
fill(255, 242, 0);
ellipse(xPos, yPos, 30, 30);
xPos+= +10;
yPos-= -10;
fill(255, 242, 0);
ellipse(xPos2, yPos2, 30, 30);
xPos2+= +20;
yPos2+= +20;
};