Upload
others
View
8
Download
0
Embed Size (px)
Citation preview
Instructor: Dr. Vlasov
EGN-1002 Introduction to Scratch
Slide: 1 Lecture is licensed under a Creative Commons Attribution 2.0 License.
EGN-1002 Circuit analysis
Module Introduction to
Scratch
Instructor: Dr. Vlasov
EGN-1002 Introduction to Scratch
Slide: 2 Lecture is licensed under a Creative Commons Attribution 2.0 License.
Introduction to Scratch
• Intro to visual programming environment • Intro to programming with multimedia • Story-telling, music-making, game-making • Intro to programming concepts: objects,
attributes, sequence, repetition, conditions, events, I/O
Instructor: Dr. Vlasov
EGN-1002 Introduction to Scratch
Slide: 3 Lecture is licensed under a Creative Commons Attribution 2.0 License.
What is Scratch
Use of scratch allows you to: • Create solutions to problems using computers • Study information • Invent algorithms • Write programs to implement the algorithms • Reuse a lot of existing program and machine parts
Scratch is a free programmable toolkit that enables users to create their own games, animated stories, and interactive art and share their creations with one another over the Internet.
Instructor: Dr. Vlasov
EGN-1002 Introduction to Scratch
Slide: 4 Lecture is licensed under a Creative Commons Attribution 2.0 License.
Start Scratch • Open web browser • Navigate to: http://scratch.mit.edu
Instructor: Dr. Vlasov
EGN-1002 Introduction to Scratch
Slide: 5 Lecture is licensed under a Creative Commons Attribution 2.0 License.
Scratch start window
Stage area
Sprite list
Scripts area
Blocks palette
Your construct your script here by putting together command blocks from the “Blocks palette”.
This is where the result of your program execution will be seen
List of existing or created objects which are used in your script.
Instructor: Dr. Vlasov
EGN-1002 Introduction to Scratch
Slide: 6 Lecture is licensed under a Creative Commons Attribution 2.0 License.
What Scratch can do
• Colors • Sounds • Locations in 2D space • Sprites • Costumes • Variables (to remember the state of things) • Events: that are broadcast for communication
Elements of Scratch: objects
• Can make cartoons • Can create stories • Can create video games
Instructor: Dr. Vlasov
EGN-1002 Introduction to Scratch
Slide: 7 Lecture is licensed under a Creative Commons Attribution 2.0 License.
Your first script
• Make sure to have a sprite selected in the “Sprite list” • Drag shown blocks into “Script area”.
• Click the sprite in the “Stage area”
Instructor: Dr. Vlasov
EGN-1002 Introduction to Scratch
Slide: 8 Lecture is licensed under a Creative Commons Attribution 2.0 License.
Add new stage
Instructor: Dr. Vlasov
EGN-1002 Introduction to Scratch
Slide: 9 Lecture is licensed under a Creative Commons Attribution 2.0 License.
Stage dimensions
These are x- and y- coordinates for the stage:
x = 240 y = 180
x = 240 y = -180
x = -240 y = -180
x = -240 y = 180
x = 0 y = 0
x
y
Instructor: Dr. Vlasov
EGN-1002 Introduction to Scratch
Slide: 10 Lecture is licensed under a Creative Commons Attribution 2.0 License.
Add new sprite
Instructor: Dr. Vlasov
EGN-1002 Introduction to Scratch
Slide: 11 Lecture is licensed under a Creative Commons Attribution 2.0 License.
Loop constructs in Scratch
• Repeat N times • Repeat forever • Repeat forever if some condition exists
Instructor: Dr. Vlasov
EGN-1002 Introduction to Scratch
Slide: 12 Lecture is licensed under a Creative Commons Attribution 2.0 License.
Compose program in Scratch
Instructor: Dr. Vlasov
EGN-1002 Introduction to Scratch
Slide: 13 Lecture is licensed under a Creative Commons Attribution 2.0 License.
Compose scripts in Scratch Examples of loops and “IF” operators:
Instructor: Dr. Vlasov
EGN-1002 Introduction to Scratch
Slide: 14 Lecture is licensed under a Creative Commons Attribution 2.0 License.
Scratch assignment No. 1 Using Scratch (scratch.mit.edu) design algorithm and script which would perform
the following: 1. Draw a car. 2. Draw a smiley face. 3. Draw a house. 4. Draw a sailboat. 5. Draw initials of the team leader. 6. Draw a robot face 7. Draw a 6-leaf flower 8. Draw 5 squares with crosses
• Save your script on your local computer. • Prepare brief printed MS-Word report with problem statement, solution description,
working script, and Scratch screen shots. • Upload the script and the report to your group file exchange section on the
BlackBoard. • Each team should be able to present (show on the screen) and explain working
scripts to the audience in class. • The printed report shall be turned in.
Instructor: Dr. Vlasov
EGN-1002 Introduction to Scratch
Slide: 15 Lecture is licensed under a Creative Commons Attribution 2.0 License.
Scratch assignment No. 2 Using Scratch (scratch.mit.edu) design algorithm and script which
would display: 1. working digital clock 2. working analog clock 3. stop watch
Create your own sprites and your own background if needed.
• Save your script on your local computer. • Prepare brief printed MS-Word report with problem statement, solution
description, working script, and Scratch screen shots. • Upload the script and the report to your group file exchange section on the
BlackBoard. • Each team should be able to present (show on the screen) and explain working
scripts to the audience in class. • The printed report shall be turned in.
Instructor: Dr. Vlasov
EGN-1002 Introduction to Scratch
Slide: 16 Lecture is licensed under a Creative Commons Attribution 2.0 License.
Scratch assignment No. 3 Using Scratch (scratch.mit.edu) design algorithm and script which
would draw a graph of function: f(x) = A sin(ax + b)
where A, a, and b are parameters which can be entered from keyboard. Create your own sprites and your own background if needed.
• Save your script on your local computer. • Prepare brief printed MS-Word report with problem statement, solution
description, working script, and Scratch screen shots. • Upload the script and the report to your group file exchange section on the
BlackBoard. • Each team should be able to present (show on the screen) and explain working
scripts to the audience in class. • The printed report shall be turned in.
Instructor: Dr. Vlasov
EGN-1002 Introduction to Scratch
Slide: 17 Lecture is licensed under a Creative Commons Attribution 2.0 License.
Scratch assignment No. 5
• Save your script on your local computer. • Prepare brief printed MS-Word report with problem statement, solution description,
working script, and Scratch screen shots. • Upload the script and the report to your group file exchange section on the BlackBoard. • Each team should be able to present (show on the screen) and explain working scripts to the
audience in class. • The printed report shall be turned in.
Using Scratch (scratch.mit.edu) design algorithm and script which would perform the following functions:
1. Rotate the vehicle with an arm until it finds (touches) the object
2. “Grab” the object 3. Rotate the vehicle with the object 180 degrees 4. Release the object 5. Move the vehicle off the object Create your own sprite and your own background.
vehicle
object
Instructor: Dr. Vlasov
EGN-1002 Introduction to Scratch
Slide: 18 Lecture is licensed under a Creative Commons Attribution 2.0 License.
Scratch assignment No. 6
Using Scratch (scratch.mit.edu) design an algorithm and a script which would move chosen sprite (a ball) in random direction inside a rectangular box and bouncing off its walls.
You may create your own sprites and your own background.
• Save your script on your local computer. • Prepare brief printed MS-Word report with problem statement, solution
description, working script, and Scratch screen shots. • Upload the script and the report to your group file exchange section on the
BlackBoard. • Each team should be able to present (show on the screen) and explain working
scripts to the audience in class. • The printed report shall be turned in.
Instructor: Dr. Vlasov
EGN-1002 Introduction to Scratch
Slide: 19 Lecture is licensed under a Creative Commons Attribution 2.0 License.
Scratch assignment No. 7
Using Scratch (scratch.mit.edu) design an algorithm and a script which would animate your team name.
Maximum length 30 seconds. Your scene needs to have theme music and a stage that reflects your personality, interests, and essence. Include suitable animation for the letters.
You may create your own sprites and your own background.
• Save your script on your local computer. • Prepare brief printed MS-Word report with problem statement, solution
description, working script, and Scratch screen shots. • Upload the script and the report to your group file exchange section on the
BlackBoard. • Each team should be able to present (show on the screen) and explain working
scripts to the audience in class. • The printed report shall be turned in.