Science 7 Coding: Project 6 – Magic 8-Ball

The objective of this project is to make your own online magic 8-ball.

https://www.khanacademy.org/computer-programming/spin-off-of-project-magic-8-ball/4762875412889600

 

fill(0, 0, 0);
ellipse(200, 200, 375, 375);
fill(60, 0, 255);
triangle(200, 104, 280, 280, 120, 280);
fill(255, 255, 255);
var answer = floor(random(1, 1000));
if (answer < 200) { text(“OF COURSE!”, 160, 200); } else if(answer > 200 && answer < 300){ text(“I DON’T”, 176, 200); text(“SEE THAT”, 167, 240); } if (answer > 300 && answer < 400) { text(“TRY AGAIN”, 165, 200); } else if(answer > 500) {
text(“MEH”, 180, 230);
}

Grade 7 Science: Coding Project 5 – Fish Tank

This exercise is a project from Khan Academy’s Intro to JS: Drawing & Animation.  

The objective of this project is to show swimming fish in the fishtank.

 

background(89, 216, 255);

var centerX = 200;
var centerY = 100;
var bodyLength = 118;
var bodyHeight = 74;
var bodyColor = color(162, 0, 255);

noStroke();
fill(bodyColor);
// body
ellipse(centerX, centerY, bodyLength, bodyHeight);
// tail
var tailWidth = bodyLength/4;
var tailHeight = bodyHeight/2;
fill(43, 43, 43);
ellipse(110, 90, 70, 100);
// eye
fill(20, 19, 20);
ellipse(centerX+bodyLength/4, centerY, bodyHeight/5, bodyHeight/5);

var fish2 = function (){
var fish2X=random(50, 350);
var fish2Y = random(50, 350);
//body of fish2
fill(bodyColor);
ellipse(fish2X,fish2Y, bodyLength, bodyHeight);
//tail of fish2
fill(255, 0, 0);
ellipse(fish2X-85,fish2Y-5, 70, 100);
//eye of fish2
fill(20, 19, 20);
ellipse(fish2X+30, fish2Y, bodyHeight/5, bodyHeight/5 );
};

fish2();
fish2();

Coding Project 5 - Fish Tank

Grade 7 Science: Coding Project 4 – Ad Design

This exercise is a project from Khan Academy’s Intro to JS: Drawing & Animation.  

The objective of this project is to design your ad for your own product.

background(6, 19, 43);

fill(245, 12, 105);
textSize(30);
text(“REAL LIFE UNICORN!!!!”, 10, 30);

fill(255, 13, 86);
textSize(20);
text(“Only $39.99!”, 50, 50);

fill(224, 27, 224);
textSize(10);
text(“THE FIRST TEN PEOPLE TO CALL 1 800 3259 GETS A 20% DISCOUNT!”, 5, 70);

Coding Project 4 - Ad Design

Grade 7 Science: Coding Project 3 – Animal Attack

This exercise is a project from Khan Academy’s Intro to JS: Drawing & Animation.  

The objective of this project is to make an animal (whatever your choice) and make it grow.  The animated video could not be uploaded to the blog.

var bodyX = 200;
var bodyY = 220;
var bodyW = 118;
var faceW = bodyW/2;

draw = function() {
background(207, 254, 255);
fill(240, 209, 36);
ellipse(bodyX, bodyY, bodyW, 106); // body?
ellipse(bodyX, bodyY+0, faceW, 47); // face?
};

Grade 7 Science: Coding Project 2 – Shooting Star

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;

};

Grade 7 Science: Coding Project 1 — What’s For Dinner?

My first project from Khan Academy’s Intro to JS: Drawing and Animation

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 of a dinner plate that includes some food items.

Legend:

Use shapes like rect()ellipse(), and triangle() to draw food on the plate. Use fill() and stroke() to color them.

background(186, 145, 20); // wooden table
//plate
fill(224, 211, 211);
ellipse(200, 200, 350, 350);
ellipse(200, 200, 300, 300);

//grapes//first level
fill(197, 25, 224);
ellipse(60, 200, 20, 20);
ellipse(80, 200, 20, 20);
ellipse(100, 200, 20, 20);
ellipse(120, 200, 20, 20);
ellipse(140, 200, 20 ,20);
//grapes//second level
ellipse(70, 220, 20, 20);
ellipse(90, 220, 20, 20);
ellipse(110, 220, 20, 20);
ellipse(130, 220, 20, 20);
//grapes//third level
ellipse(80, 240, 20, 20);
ellipse(100, 240, 20, 20);
ellipse(120, 240, 20, 20);
//grapes//fourth level
ellipse(90, 260, 20, 20);
ellipse(110,260, 20, 20);
//grapes//fifth level
ellipse(100, 280, 20, 20);
//grape’s stem//bottom level
fill(96, 240, 12);
ellipse(90, 180, 20, 20);
ellipse(110, 180, 20, 20);
//grape’s stem//top level
ellipse(100, 160, 20, 20);

//mashed potatos
fill(242, 230, 230);
ellipse(200, 300, 150, 100);
ellipse(250, 300, 120, 100);

//drumstick
fill(138, 15, 15);
ellipse(170, 100, 130, 50);
//drumstick bone
fill(235, 218, 218);
rect(200, 85, 100, 30);

//apple
fill(255, 0, 0);
ellipse(220, 200, 100, 100);
//apple stem
fill(107, 14, 14);
rect(200, 130, 40, 30);
//apple stem//leaf
fill(83, 212, 19);
ellipse(240, 130, 20, 30);

//peas
fill(24, 237, 5);
ellipse(300, 250, 30, 30);
ellipse(300, 220, 30, 30);
ellipse(330, 210, 30, 30);
ellipse(330, 240, 30, 30);
ellipse(340, 180, 30, 30);
ellipse(310, 190, 30, 30);
ellipse(300, 160, 30, 30);
ellipse(330, 160, 30, 30);

 

Project 1 What's For Dinner v2

 

Design a site like this with WordPress.com
Get started