Island 1 Level 2 Intermediate Programming with Scratch v3
Computer Programming
POP students are challenged to find a program in Scratch and change the by programming a new challenge.
Level 2 - Intermediate Programming with Scratch v3
What is Computer Programming?
What Are Computers?
Computers are systems of switches. Each switch can be in an ON or OFF state represented as a 1 or 0. This is known as binary code. The first computer programmers had to actually program using binary code. It was almost impossible to do anything very complex this way.
Today, we program computers using programming languages that simplify our work. Programming languages use commands or lines of instructions. Commands can be organized in different ways to control the behavior of a computer. There are many types of computer programming languages. Each language has different abilities and uses. Despite their more complex capabilities, programming languages are just more effective ways of manipulating large numbers of binary switches behind the scenes.
What Is Object-Oriented Programming?
Scratch uses object-oriented programming to control the appearance and behavior of objects. Object-oriented programming simplifies programming by bundling lots of instructions into an object. Computer objects are like objects in the real world. Every object has a state and behavior. For example, think about a dog. The dog’s state includes its name, its color, breed, size, and other characteristics. In object-oriented programming, “state” refers to characteristics of an object. The dog’s behavior includes sleeping, running, barking, and other things dogs do. In computer programming, “behavior” is the things an object can do.
Position and Movement
In order to create games and advanced animations, we need to learn more ways to move the Sprite. In your science and math classes, you probably learned different ways to describe the position and direction of movement of objects. Let’s review two approaches. One system uses a coordinate system based on pairs of numbers (X, Y). Another uses angles from 0 to 360 degrees.
The Illusion of Depth and Space
How do you make an object appear to move away or toward you on a two-dimensional (flat) Stage? Hold your finger in front of your nose. Move your finger toward and away from your nose. Notice that the finger appears to change size. Does it really? No. But, as your finger moves away from your eyes, it appears to shrink.
To give your Sprites the illusion of movement, you need to change their position and size.
Use Looks blocks to program a change in the size of the Sprite.