Skip to content

Please update your browser

Your browser version is not supported by this site. CS First may not work properly. Learn more.

https://storage.googleapis.com/files.cs-first.com/art/art-icon%402x.png

1. Introduction to Graffiti

Transcript

(happy music)

Hi, and welcome to day five of Scratch Art.

Today, you will create an interactive graffiti game while learning about an important computer science concept called conditionals.

Conditionals are a way for computers to make decisions.

In most computer languages, conditionals start with the word if.

If statements can be read, if something is true, then do this action.

Like if you are tired, then take a nap, or if the paint brushes are dirty, then wash them.

Conditionals are used all the time in computer science.

They are even used in programs that help historians restore art.

Many historical pieces of art have been damaged over the years.

Exposure to direct sunlight discolors and fades paintings over time.

Dust and dirt accumulates on paintings over decades, even centuries, dulling the artist's original colors.

Art restoration attempts to return these damaged works of art to their original beauty.

Art restoration is a painstaking process.

Computer scientists can help make it easier, though.

Using calculations based on old photographs of a piece of art, computer scientists generate digital images showing how it looked originally.

But historians may not want to change the original work to restore it, because doing so would change the artwork forever.

Instead, museums create special visual displays that make each tiny section of a damaged painting into a pixel.

A computer program compares each pixel to the computer generated version of the original.

If the colors of two pixels do not match, then projections are directed at that part of the artwork, creating and optical illusion that makes the human eye see the painting's original color.

With the help of computer science and if then statements, everyone can enjoy viewing artwork the way the artist originally intended it without changing the masterpiece itself.

You can program some conditionals of your own in Scratch, using an if then block.

Check out this example of a Scratch project that uses an if then statement.

The if then block here can be read as, if the mouse pointer is touching the elephant sprite, then change the sprite's color effect by ten.

In today's project, you will program an interactive graffiti game using an if then block.

Users will be able to create their own graffiti masterpieces in Scratch using your project.

When the user clicks and drags the mouse, spray paint appears on the wall.

This video will introduce remixing the starter project.

To start your graffiti project, click the starter project link next to this video.

Click Sign In to Scratch.

And click Remix.

The starter project contains a brick wall stage and a spray paint sprite.

There is no code in the starter project yet.

It is your job to add the code.

Now it's your turn.

Click the starter project.

Sign in.

Click Remix.

Instructions
  1. Remix the Graffiti Starter Project.
  2. Sign in to Scratch.
Attributions
  • "Alvin Law maniuplates the image after capturing it." by Sarah Stierch (https://www.flickr.com/photos/sarahvain/3458785379/in/photostream/) -- Licensed by CC BY 2.0 (https://creativecommons.org/licenses/by/2.0/) -- Image scaled up, cropping edges
  • "Hidden Canvas Revealed" by Osbornb (https://www.flickr.com/photos/osbornb/4743695784/) -- Licensed by CC BY 2.0 (https://creativecommons.org/licenses/by/2.0/) -- Image scaled up, cropping edges
  • "Palazzo Spinelli Group - Promo 2014' by Palazzo Spinelli Group (https://www.youtube.com/watch?v=NQ6mx3nbrjc) -- Licensed by Creative Commons Attribution 3.0 Unported (https://creativecommons.org/licenses/by/3.0/legalcode) -- Video trimmed to needed length | Audio removed | Video stabilized in some parts
  • "Painting damandged by fire" by Mbboston (https://commons.wikimedia.org/wiki/File:Painting_damaged_by_fire.jpg) -- Licensed by Creative Commons Attribution 3.0 Unported (https://creativecommons.org/licenses/by/3.0/legalcode) -- Image scaled up, cropping edges