We will take 15 minutes to address these comments:
We will spend 30 minutes on our research journaling.
Please include screen shots of all your projects.
You can use the internet:
KEY PRESS
// Name: // Date // Keypress project // SECTION 1 int x = 20; int y = 20; //SECTION 2 void setup() { //setup function called initially, only once size(500, 400); } //SECTION 3 void draw() { //draw function loops background(255); // makes it black fill(255,0,0); ellipse(mouseX,mouseY,20,20); fill(0,255,0); ellipse(x,y,20,20); if (key == 'd'){ x = x+1; } }
SCREEN SAVER BALL
int x = 50; // variables int y = 50; int dx = 9; // velocity (9,5) int dy = 5; void setup() { //setup function called initially, only once size(500, 250); background(255); //set background white } void draw() { //draw function loops ellipse(x,y,20,20); x = x + dx; y = y + dy; if (x > 500) { // X axis collision dx = -9; } else if (x < 0) { dx = 9; } if (y > 250) { // Y axis collision dy *= -1; // the same as dy = dy*(-1) } else if (y < 0) { dy *= -1; } }