Top Banner
1 Starting to Program From Scratch scratch is a new programming language that lets you create your own interactive stories, animations, games, music, and art. Prepared by Fred Annexstein University of Cincinnati Some rights reserved 007 Supporting Issues Programming Logic CS110: Intro to Computer Science Core Issue Programming Concepts
16

1 Starting to Program From Scratch scratch is a new programming language that lets you create your own interactive stories, animations, games, music, and.

Dec 19, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 Starting to Program From Scratch scratch is a new programming language that lets you create your own interactive stories, animations, games, music, and.

1

Starting to Program From Scratch

scratch is a new programming language that lets you create your own interactive stories, animations, games, music, and art.

Prepared by Fred AnnexsteinUniversity of Cincinnati

Some rights reserved 007

Supporting IssuesProgramming Logic

CS110: Intro to Computer Science

Core IssueProgramming Concepts

Page 2: 1 Starting to Program From Scratch scratch is a new programming language that lets you create your own interactive stories, animations, games, music, and.

2

Beginning Programming

Download Scratch! from scratch.mit.edu

Page 3: 1 Starting to Program From Scratch scratch is a new programming language that lets you create your own interactive stories, animations, games, music, and.

3

Interpreted

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html> <head> <title>Hello, World!</title> </head> <body> Hello, World! </body> </html>

Varieties of Computer Languages

Compiled int main(int argc, char * argv[]) { printf("Hello world!"); exit(0); } 10000011 00000001 00010001 00000000 00111101 11111100 01110100 00111101 00000000 01000000 00000000 00000000 00000000 00000000 00000000 00000000 10010000 00000000 00000000 00000000 01010000 00000000 00000111 00110000 00001011 00000001 00001011 00000011 00001010 0000000000000000 00

Page 4: 1 Starting to Program From Scratch scratch is a new programming language that lets you create your own interactive stories, animations, games, music, and.

4

QuickTime™ and a decompressor

are needed to see this picture.

The Scratch Interpreted Environment

8 Categories of Programming Objects

Page 5: 1 Starting to Program From Scratch scratch is a new programming language that lets you create your own interactive stories, animations, games, music, and.

5

Scratch Programming Elements

QuickTime™ and a decompressor

are needed to see this picture.

Looks:

Control:

Sound:

Page 6: 1 Starting to Program From Scratch scratch is a new programming language that lets you create your own interactive stories, animations, games, music, and.

6

QuickTime™ and a decompressor

are needed to see this picture.

Page 7: 1 Starting to Program From Scratch scratch is a new programming language that lets you create your own interactive stories, animations, games, music, and.

7

QuickTime™ and a decompressor

are needed to see this picture.

Boolean Expressions and Boolean connectives

Sensing:

Numbers:

Page 8: 1 Starting to Program From Scratch scratch is a new programming language that lets you create your own interactive stories, animations, games, music, and.

8

QuickTime™ and a decompressor

are needed to see this picture.

Conditionals: If then else statements:

QuickTime™ and a decompressor

are needed to see this picture.

Page 9: 1 Starting to Program From Scratch scratch is a new programming language that lets you create your own interactive stories, animations, games, music, and.

9

QuickTime™ and a decompressor

are needed to see this picture.

Basic Repetition: Loops

QuickTime™ and a decompressor

are needed to see this picture.

Page 10: 1 Starting to Program From Scratch scratch is a new programming language that lets you create your own interactive stories, animations, games, music, and.

10

QuickTime™ and a decompressor

are needed to see this picture.

Using Program Variables

Page 11: 1 Starting to Program From Scratch scratch is a new programming language that lets you create your own interactive stories, animations, games, music, and.

11

QuickTime™ and a decompressor

are needed to see this picture.

Programming the Movement of a Sprite

Page 12: 1 Starting to Program From Scratch scratch is a new programming language that lets you create your own interactive stories, animations, games, music, and.

12

Programming the Movement Multiple Sprites:Threads

QuickTime™ and a decompressor

are needed to see this picture.

QuickTime™ and a decompressor

are needed to see this picture.

Page 13: 1 Starting to Program From Scratch scratch is a new programming language that lets you create your own interactive stories, animations, games, music, and.

13

Programming Events

QuickTime™ and a decompressor

are needed to see this picture.

QuickTime™ and a decompressor

are needed to see this picture.

Page 14: 1 Starting to Program From Scratch scratch is a new programming language that lets you create your own interactive stories, animations, games, music, and.

14

Game Programming: “Knock the Kitty in Hole”

Basic Design:

1. Start the game with 0 score and pick random location at top to drop the Kitty

2. Use a touching mouse? sensing event to grab kitty and knock into hole.

3. Use a touching hole? sensing event to add to score and drop another kitty.

Page 15: 1 Starting to Program From Scratch scratch is a new programming language that lets you create your own interactive stories, animations, games, music, and.

15

Game Programming: “Knock the Kitty in Can”

Page 16: 1 Starting to Program From Scratch scratch is a new programming language that lets you create your own interactive stories, animations, games, music, and.

16

Project to turn in:

Modify the Game above to include another sprite into the action.

Turn in your project by saving the scratch program and uploading to Bb.