25
Introduction to Animation Programming Our next set of exercises will look at animation on the following link: https://www.khanacademy.org/cs/ programming/animation-basics/ p/intro-to-animation

Introduction to Animation Programming

  • Upload
    idra

  • View
    77

  • Download
    0

Embed Size (px)

DESCRIPTION

Introduction to Animation Programming. Our next set of exercises will look at animation on the following link: https://www.khanacademy.org/cs/programming/animation-basics/p/intro-to-animation. Making Animation. - PowerPoint PPT Presentation

Citation preview

Page 1: Introduction to Animation Programming

Introduction to Animation Programming

• Our next set of exercises will look at animation on the following link:

https://www.khanacademy.org/cs/programming/animation-basics/p/intro-to-animation

Page 2: Introduction to Animation Programming

Making Animation

• If you take a picture and have it redraw it a lot with small changes, you can create the illusion of an animation. As an object moves to the right, redraw the background then redraw the object with a slightly different x value. This can make something drive across the screen.

Page 3: Introduction to Animation Programming

noStroke();// position of the carvar x = -50;var draw = function() { background(252, 255, 214); x=x+3; // draw the car body fill(255, 0, 115); rect(x, 200, 100, 20); rect(x + 15, 178, 70, 40); // draw the wheels fill(77, 66, 66); ellipse(x + 25, 221, 24, 24); ellipse(x + 75, 221, 24, 24); if(x===400){x=-50;}};

Page 4: Introduction to Animation Programming

Practice 1, 20%

• Your moving vehicle should go faster and be original in color and shape.

• Display the work you have done on your web page entitled 26.htm with a screenshot so that you may upload your progress. Write a paragraph about what you did on your web page. (your paragraph may be the same as what you wrote on your quiz).

Page 5: Introduction to Animation Programming

Review

• Introduction to Animation Programming• Making Animation• Code Example• Practice 1, 20%

Page 6: Introduction to Animation Programming

MAKE THE SUN EXPLODE AND THE MOUSE MOVE TO EAT AN APPLE https://www.khanacademy.org/cs/

programming/animation-basics/p/challenge-exploding-sun

Page 7: Introduction to Animation Programming
Page 8: Introduction to Animation Programming

HTML REVIEW<html><body><img src=“26sun.png”><p> This is my paragraph </p></body></html>

Page 9: Introduction to Animation Programming

Practice 2, 20%Add a screen shot and a paragraph to show

what you have done to make the sun explode

Add a screen shot and a paragraph to show what you have done to make the mouse eat the apple.

Page 10: Introduction to Animation Programming

REVIEW Make the sun explode and the mouse to

move to eat an apple Code example HTML review Practice 2, 20%

Page 11: Introduction to Animation Programming

Crazy Painterhttps://www.khanacademy.org/cs/

programming/animation-basics/p/project-crazy-painter

Page 12: Introduction to Animation Programming

SPIN OFFS The cloud service at the Khan web site

has enables users to create extensions of the listed projects and post their own answers. To do it, a user would have to be logged in. We don’t need to log in to see the other student’s spin offs. Try seeing what some others have done before completing your own attempt.

Page 13: Introduction to Animation Programming

noStroke(); //sets shapes to not have an outline

var draw = function() { fill(mouseX, 0, 0); //changes colors based

on mouse ellipse(mouseX, mouseY, 10, 10); //draws

circle};

Page 14: Introduction to Animation Programming

PRACTICE 3, 20% Add a screen shot and a paragraph

explaining your favorite spinoff to your 26.htm web page.

Add a screen shot and a paragraph explaining your own Crazy Painter program.

Page 15: Introduction to Animation Programming

ReviewCrazy PainterSpin OffsCode ExamplePractice 3, 20%

Page 16: Introduction to Animation Programming

noStroke(); //removes the perimeter of the shape

var leftX = 145; //the start position of the left cloud

var rightX = 270; //the start position of the right cloud

var sunRadius = 100; //the size of the sun

Page 17: Introduction to Animation Programming

var draw = function() { background(184, 236, 255); //makes the blue sky

fill(255, 170, 0); //makes the sun yellow ellipse(200, 100, sunRadius, sunRadius);//circle for sun // clouds fill(255, 255, 255); // left cloud ellipse(leftX, 150, 126, 97); ellipse(leftX+62, 150, 70, 60); ellipse(leftX-62, 150, 70, 60); // right cloud ellipse(rightX, 100, 126, 97); ellipse(rightX+62, 100, 70, 60); ellipse(rightX-62, 100, 70, 60);

};

Page 18: Introduction to Animation Programming

sunRadius+=2; //makes the sun explode rightX+=1; //moves right cloud right leftX-=1; //moves left cloud left

Page 19: Introduction to Animation Programming

Practice 4, 20%

Get a screen shot and write a paragraph for your project 26.htm web page from:

https://www.khanacademy.org/cs/programming/animation-basics/p/challenge-parting-clouds

Page 20: Introduction to Animation Programming

ReviewCode example: initial setupCode example: shape drawingCode example: increasing variables for shape

movePractice 4, 20%

Page 21: Introduction to Animation Programming

RUBRIC PART 1 (20 POINTS EACH) Slide 4: Picture and Paragraph showing

a vehicle with an original design and an increased speed from the example.

Slide 9a: Picture and paragraph to show how you solved the challenge to have the mouse eat the food item on the screen

Slide 9b: Show picture and paragraph on sun explosions.

Page 22: Introduction to Animation Programming

Rubric Part 2 (20 Points each)Slide 14a: Screen shot and a paragraph

explaining your favorite spinoff from the crazy painter

Slide 14b: Picture and paragraph on your own crazy painter programrazy Painter program.

Slide 19: Picture and a paragarph on how you made the clouds part and the sun get larger

Page 23: Introduction to Animation Programming

REGISTERING WITH KHAN The https://www.khanacademy.org/ web

site has the ability to create an account for free. This can be down with an email address. By registering a student can keep track of their score and explore the learning opportunities. Additionally, a student could become a part of the online community! Start leaving spinoffs and comments today!

Page 24: Introduction to Animation Programming

Implementing Khan to External ProjectsBy directly accessing the processing.JS script

that is used on the Khan web site, we can make our web pages run independently. When set up correctly, a programmer can develop ideas with the online service and then use the ideas on a personal site. That is beyond the scope of this project, but extended learning can be found at processingjs.org.

Page 25: Introduction to Animation Programming

REVIEW Rubric Part 1 Rubric Part 2 Registering With Khan Implementing Khan to External Projects