Assignment 4

You will be creating a game of Rock-Paper-Scissors in program called Scratch. Scratch is a visual programming language created by MIT for the purpose of learning programming. It touches on many of the basic concepts in popular programming languages used today, such as C, C++, Java, and Python.

This assignment will be out of 1000 possible points.

Getting started:

  1. We recommend using the online editor at scratch.mit.edu. From this page, click on the "Create" link at the top left of the page to open the Scratch editor.
  2. Read through the brief Concepts Covered and Overview of Scratch sections below.
  3. For more help, check out these two fully-functional Scratch program examples by right-clicking on the links and selecting "Save link as...". Then open them on your computer.
  4. Using Firefox or Chrome (NOT Safari) download and open the skeleton starter file by right-clicking on the link and selecting "Save link as...". You can upload this to the online Scratch editor by selecting (within Scratch) "File > Load from your computer".
  5. Once you have finished your program, you will have to use "File > Download to your computer" to save the file you will later submit to Canvas.

Concepts Covered:

Overview of Scratch:

The idea behind creating programs in Scratch is to drag and drop blocks you want to use from the Code blocks window into your Scripts window. There are several menus and windows that are important to understand, and they are illustrated in the image below. Blocks/scripts can be rearranged within the Scripts window by dragging the top block wherever you want (all blocks attached under the top block move as one). A white line appears when inserting a block in-between blocks, letting you know where it'll insert.

Assignment Requirements:

  1. Change the background image for the stage. (100 points)
  2. Create a sprite for the player (so the Player sprite can play against the Computer sprite). (100 points)
  3. Add three costumes for the player: a rock, a piece of paper, and scissors (or use three images of your choice - just be consistent!). (50 points)
  4. Add three additional costumes for the computer (leaving the question mark as the fourth costume). (50 points)
  5. Add script to the Player sprite, so it will change costumes when it is clicked. (100 points)
  6. Add script to the Computer sprite, so when the Go button is pressed, the Computer sprite changes costumes to a question mark and then changes to a random costume (either the rock, paper, or scissors costume). (200 points)
  7. Add script to the Go button sprite that determines who the winner of the round was. (200 points)
  8. Add script to the Go button sprite that displays who won the round (Computer, Player, or Draw). (100 points)
  9. Add script to the Go button sprite that increments the score for the winner. (100 points)

Extra credit (for up to a maximum 100 extra points):

SUBMIT your Scratch file (with any file name) to Canvas under Assignment 4.

Descriptions of Examples:

Thank you to Daniel Hiranandani for his help developing this aassignment. Revised by Jeremy Baumgartner.